Add missing -DNO_THREADS trylock and make minor change to TLS

in attempt to get it work with GNU PTH.
This commit is contained in:
Kurt Zeilenga 2000-06-07 23:58:16 +00:00
parent c6e4ad6c12
commit 0eb19657fa
2 changed files with 9 additions and 3 deletions

View File

@ -66,9 +66,9 @@ static ldap_pvt_thread_mutex_t tls_mutexes[CRYPTO_NUM_LOCKS];
static void tls_locking_cb( int mode, int type, const char *file, int line )
{
if ( mode & CRYPTO_LOCK ) {
ldap_pvt_thread_mutex_lock( tls_mutexes+type );
ldap_pvt_thread_mutex_lock( &tls_mutexes[type] );
} else {
ldap_pvt_thread_mutex_unlock( tls_mutexes+type );
ldap_pvt_thread_mutex_unlock( &tls_mutexes[type] );
}
}
@ -83,7 +83,7 @@ static void tls_init_threads( void )
int i;
for( i=0; i< CRYPTO_NUM_LOCKS ; i++ ) {
ldap_pvt_thread_mutex_init( tls_mutexes+i );
ldap_pvt_thread_mutex_init( &tls_mutexes[i] );
}
CRYPTO_set_locking_callback( tls_locking_cb );
/* FIXME: the thread id should be added somehow... */

View File

@ -126,6 +126,12 @@ ldap_int_thread_mutex_lock( ldap_int_thread_mutex_t *mutex )
return 0;
}
int
ldap_int_thread_mutex_trylock( ldap_int_thread_mutex_t *mutex )
{
return 0;
}
int
ldap_int_thread_mutex_unlock( ldap_int_thread_mutex_t *mutex )
{