mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
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:
parent
c6e4ad6c12
commit
0eb19657fa
@ -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... */
|
||||
|
@ -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 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user