X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=mt%2Fmttest.c;h=8651a1131a088532e83ee2be3af80f4507bc59ec;hp=3a927a293754129acd4706fd0227684eec8855c6;hb=888007108bc3cd1011d145470f6295743f4909d6;hpb=b7896b3cb86d80206af14a14d69b0717786f2729 diff --git a/mt/mttest.c b/mt/mttest.c index 3a927a2937..8651a1131a 100644 --- a/mt/mttest.c +++ b/mt/mttest.c @@ -1,5 +1,5 @@ /* mt/mttest.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -82,7 +82,7 @@ #include "ssl.h" #include "err.h" -#ifdef WIN16 +#ifdef NO_FP_API #define APPS_WIN16 #include "../crypto/buffer/bss_file.c" #endif @@ -98,25 +98,31 @@ int MS_CALLBACK verify_callback(int ok, X509 *xs, X509 *xi, int depth, void thread_setup(void); void thread_cleanup(void); void do_threads(SSL_CTX *s_ctx,SSL_CTX *c_ctx); + void irix_locking_callback(int mode,int type,char *file,int line); 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 linux_locking_callback(int mode,int type,char *file,int line); +void pthreads_locking_callback(int mode,int type,char *file,int line); + unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); -unsigned long linix_thread_id(void ); +unsigned long pthreads_thread_id(void ); + #else int MS_CALLBACK verify_callback(); void thread_setup(); void thread_cleanup(); void do_threads(); + void irix_locking_callback(); void solaris_locking_callback(); void win32_locking_callback(); -void linux_locking_callback(); +void pthreads_locking_callback(); + unsigned long irix_thread_id(); unsigned long solaris_thread_id(); -unsigned long linix_thread_id(); +unsigned long pthreads_thread_id(); + #endif BIO *bio_err=NULL; @@ -700,7 +706,7 @@ char *arg; #ifdef WIN32 -static HANDLE lock_cs[CRYPTO_NUM_LOCKS]; +static PRLOCK lock_cs[CRYPTO_NUM_LOCKS]; void thread_setup() { @@ -792,7 +798,7 @@ SSL_CTX *s_ctx,*c_ctx; printf("win32 threads done - %.3f seconds\n",ret); } -#endif +#endif /* WIN32 */ #ifdef SOLARIS @@ -903,7 +909,7 @@ unsigned long solaris_thread_id() ret=(unsigned long)thr_self(); return(ret); } -#endif +#endif /* SOLARIS */ #ifdef IRIX @@ -1001,5 +1007,109 @@ unsigned long irix_thread_id() ret=(unsigned long)getpid(); return(ret); } +#endif /* IRIX */ + +#ifdef PTHREADS + +static pthread_mutex_t lock_cs[CRYPTO_NUM_LOCKS]; +static long lock_count[CRYPTO_NUM_LOCKS]; + +void thread_setup() + { + int i; + + for (i=0; ireferences,c_ctx->references); + } + +unsigned long pthreads_thread_id() + { + unsigned long ret; + + ret=(unsigned long)pthread_self(); + return(ret); + } + +#endif /* PTHREADS */ + +