From: Kurt Zeilenga Date: Wed, 7 Jun 2000 23:58:16 +0000 (+0000) Subject: Add missing -DNO_THREADS trylock and make minor change to TLS X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2711 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0eb19657fa8360c49e95024a3e3a8f1932a79173;p=openldap Add missing -DNO_THREADS trylock and make minor change to TLS in attempt to get it work with GNU PTH. --- diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 20e5a2b4ad..9e49d64197 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -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... */ diff --git a/libraries/libldap_r/thr_stub.c b/libraries/libldap_r/thr_stub.c index c4dc6acdfd..6759117904 100644 --- a/libraries/libldap_r/thr_stub.c +++ b/libraries/libldap_r/thr_stub.c @@ -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 ) {