From ff48c0d9098080b51ea12710029135916d117806 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 30 Mar 2010 12:36:28 +0000 Subject: svn merge -r514:HEAD ^/branches/released . --- openssl/crypto/threads/mttest.c | 99 +++++++++++++++++++++++++++++++++ openssl/crypto/threads/pthreads-vms.com | 9 ++- 2 files changed, 106 insertions(+), 2 deletions(-) (limited to 'openssl/crypto/threads') diff --git a/openssl/crypto/threads/mttest.c b/openssl/crypto/threads/mttest.c index f6f3df4b6..eba7aa8a6 100644 --- a/openssl/crypto/threads/mttest.c +++ b/openssl/crypto/threads/mttest.c @@ -117,11 +117,13 @@ void solaris_locking_callback(int mode,int type,char *file,int line); void win32_locking_callback(int mode,int type,char *file,int line); void pthreads_locking_callback(int mode,int type,char *file,int line); void netware_locking_callback(int mode,int type,char *file,int line); +void beos_locking_callback(int mode,int type,const char *file,int line); unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); unsigned long pthreads_thread_id(void ); unsigned long netware_thread_id(void ); +unsigned long beos_thread_id(void ); #if defined(OPENSSL_SYS_NETWARE) static MPKMutex *lock_cs; @@ -1209,3 +1211,100 @@ unsigned long netware_thread_id(void) return(ret); } #endif /* NETWARE */ + +#ifdef BEOS_THREADS + +#include + +static BLocker** lock_cs; +static long* lock_count; + +void thread_setup(void) + { + int i; + + lock_cs=(BLocker**)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(BLocker*)); + lock_count=(long*)OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); + for (i=0; iLock(); + lock_count[type]++; + } + else + { + lock_cs[type]->Unlock(); + } + } + +void do_threads(SSL_CTX *s_ctx, SSL_CTX *c_ctx) + { + SSL_CTX *ssl_ctx[2]; + thread_id thread_ctx[MAX_THREAD_NUMBER]; + int i; + + ssl_ctx[0]=s_ctx; + ssl_ctx[1]=c_ctx; + + for (i=0; ireferences,c_ctx->references); + } + +unsigned long beos_thread_id(void) + { + unsigned long ret; + + ret=(unsigned long)find_thread(NULL); + return(ret); + } + +#endif /* BEOS_THREADS */ diff --git a/openssl/crypto/threads/pthreads-vms.com b/openssl/crypto/threads/pthreads-vms.com index 63f5b8cc2..1cf92bdf5 100644 --- a/openssl/crypto/threads/pthreads-vms.com +++ b/openssl/crypto/threads/pthreads-vms.com @@ -2,8 +2,13 @@ $! To compile mttest on VMS. $! $! WARNING: only tested with DEC C so far. $ -$ arch := vax -$ if f$getsyi("CPU") .ge. 128 then arch := axp +$ if (f$getsyi("cpu").lt.128) +$ then +$ arch := VAX +$ else +$ arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE") +$ if (arch .eqs. "") then arch = "UNK" +$ endif $ define/user openssl [--.include.openssl] $ cc/def=PTHREADS mttest.c $ link mttest,[--.'arch'.exe.ssl]libssl/lib,[--.'arch'.exe.crypto]libcrypto/lib -- cgit v1.2.3