protect assertion behind mutex (test should be atomic anyway...)

This commit is contained in:
Pierangelo Masarati 2006-12-14 19:22:00 +00:00
parent 28a1868127
commit d29d83a80e

View file

@ -303,10 +303,10 @@ static Connection* connection_get( ber_socket_t s )
if( c != NULL ) {
ber_socket_t sd;
assert( c->c_struct_state != SLAP_C_UNINITIALIZED );
ldap_pvt_thread_mutex_lock( &c->c_mutex );
assert( c->c_struct_state != SLAP_C_UNINITIALIZED );
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
if( c->c_struct_state != SLAP_C_USED ) {
/* connection must have been closed due to resched */