version 1.69, 2006/08/09 21:12:42
|
version 1.72, 2006/08/22 17:49:09
|
|
|
if ( mode & CRYPTO_LOCK ) | if ( mode & CRYPTO_LOCK ) |
{ | { |
/*Tracer::trace(TRC_SSL, Tracer::LEVEL4, | /*Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"Now locking for %d", Threads::self());*/ |
"Now locking for %d", Threads::id());*/ |
SSLContextRep::_sslLocks.get()[type].lock( Threads::self() ); |
SSLContextRep::_sslLocks.get()[type].lock( ); |
} | } |
else | else |
{ | { |
/*Tracer::trace(TRC_SSL, Tracer::LEVEL4, | /*Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"Now unlocking for %d", Threads::self());*/ |
"Now unlocking for %d", Threads::id());*/ |
SSLContextRep::_sslLocks.get()[type].unlock( ); | SSLContextRep::_sslLocks.get()[type].unlock( ); |
} | } |
} | } |
| |
|
static unsigned long _get_thread_id() |
|
{ |
|
#if defined(PEGASUS_HAVE_PTHREADS) |
|
return pthread_self(); |
|
#else |
|
return 0; |
|
#endif |
|
} |
|
|
// | // |
// Initialize OpenSSL Locking and id callbacks. | // Initialize OpenSSL Locking and id callbacks. |
// | // |
|
|
| |
// Set the ID callback. The ID callback returns a thread ID. | // Set the ID callback. The ID callback returns a thread ID. |
| |
CRYPTO_set_id_callback((CRYPTO_SET_ID_CALLBACK) Threads::self); |
CRYPTO_set_id_callback((CRYPTO_SET_ID_CALLBACK)_get_thread_id); |
| |
// Set the locking callback to pegasus_locking_callback. | // Set the locking callback to pegasus_locking_callback. |
| |
|
|
// load SSL library | // load SSL library |
// | // |
Tracer::trace(TRC_SSL, Tracer::LEVEL4, | Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"Before calling SSL_load_error_strings %d", Threads::self()); |
"Before calling SSL_load_error_strings %d", Threads::id()); |
| |
SSL_load_error_strings(); | SSL_load_error_strings(); |
| |
Tracer::trace(TRC_SSL, Tracer::LEVEL4, | Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"After calling SSL_load_error_strings %d", Threads::self()); |
"After calling SSL_load_error_strings %d", Threads::id()); |
| |
Tracer::trace(TRC_SSL, Tracer::LEVEL4, | Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"Before calling SSL_library_init %d", Threads::self()); |
"Before calling SSL_library_init %d", Threads::id()); |
| |
SSL_library_init(); | SSL_library_init(); |
| |
Tracer::trace(TRC_SSL, Tracer::LEVEL4, | Tracer::trace(TRC_SSL, Tracer::LEVEL4, |
"After calling SSL_library_init %d", Threads::self()); |
"After calling SSL_library_init %d", Threads::id()); |
|
|
} | } |
| |
_countRep++; | _countRep++; |