X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=mt%2Fmttest.c;h=b2f332602dac1efd21c3340edacac457ee0e1cdb;hp=3a927a293754129acd4706fd0227684eec8855c6;hb=b96eb06f7907da2fef89c0c7b89ce4dedc593ecc;hpb=d02b48c63a58ea4367a0e905979f140b7d090f86 diff --git a/mt/mttest.c b/mt/mttest.c index 3a927a2937..b2f332602d 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 @@ -74,15 +74,15 @@ #include #include #endif -#include "lhash.h" -#include "crypto.h" -#include "buffer.h" +#include +#include +#include #include "../e_os.h" -#include "x509.h" -#include "ssl.h" -#include "err.h" +#include +#include +#include -#ifdef WIN16 +#ifdef NO_FP_API #define APPS_WIN16 #include "../crypto/buffer/bss_file.c" #endif @@ -92,32 +92,20 @@ #define MAX_THREAD_NUMBER 100 -#ifndef NOPROTO int MS_CALLBACK verify_callback(int ok, X509 *xs, X509 *xi, int depth, int error,char *arg); 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 ); -#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(); -unsigned long irix_thread_id(); -unsigned long solaris_thread_id(); -unsigned long linix_thread_id(); -#endif +unsigned long pthreads_thread_id(void ); BIO *bio_err=NULL; BIO *bio_stdout=NULL; @@ -133,12 +121,7 @@ int number_of_loops=10; int reconnect=0; int cache_stats=0; -#ifndef NOPROTO int doit(char *ctx[4]); -#else -int doit(); -#endif - static void print_stats(fp,ctx) FILE *fp; SSL_CTX *ctx; @@ -700,7 +683,7 @@ char *arg; #ifdef WIN32 -static HANDLE lock_cs[CRYPTO_NUM_LOCKS]; +static PRLOCK lock_cs[CRYPTO_NUM_LOCKS]; void thread_setup() { @@ -792,7 +775,7 @@ SSL_CTX *s_ctx,*c_ctx; printf("win32 threads done - %.3f seconds\n",ret); } -#endif +#endif /* WIN32 */ #ifdef SOLARIS @@ -903,7 +886,7 @@ unsigned long solaris_thread_id() ret=(unsigned long)thr_self(); return(ret); } -#endif +#endif /* SOLARIS */ #ifdef IRIX @@ -1001,5 +984,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 */ + +