]> git.sur5r.net Git - openldap/commitdiff
Add missing -DNO_THREADS trylock and make minor change to TLS
authorKurt Zeilenga <kurt@openldap.org>
Wed, 7 Jun 2000 23:58:16 +0000 (23:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 7 Jun 2000 23:58:16 +0000 (23:58 +0000)
in attempt to get it work with GNU PTH.

libraries/libldap/tls.c
libraries/libldap_r/thr_stub.c

index 20e5a2b4ad0604b8fd0f8a26274568b8035667ac..9e49d641976e17d49c5d9af47633c66115b3547c 100644 (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... */
index c4dc6acdfd49de86638227e5cc56a66d4c05b26c..6759117904dc9b6d4ec6241f744a0504a16f0546 100644 (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 )
 {