mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Move initialization of Connection mutexes to connections_init
This commit is contained in:
parent
8158888085
commit
e9fa4af4d8
@ -122,7 +122,13 @@ int connections_init(void)
|
||||
assert( connections[0].c_struct_state == SLAP_C_UNINITIALIZED );
|
||||
assert( connections[dtblsize-1].c_struct_state == SLAP_C_UNINITIALIZED );
|
||||
|
||||
for (i=0; i<dtblsize; i++) connections[i].c_conn_idx = i;
|
||||
for (i=0; i<dtblsize; i++) {
|
||||
connections[i].c_conn_idx = i;
|
||||
ldap_pvt_thread_mutex_init( &connections[i].c_mutex );
|
||||
ldap_pvt_thread_mutex_init( &connections[i].c_write1_mutex );
|
||||
ldap_pvt_thread_cond_init( &connections[i].c_write1_cv );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* per entry initialization of the Connection array initialization
|
||||
@ -350,6 +356,8 @@ Connection * connection_init(
|
||||
assert( s >= 0 );
|
||||
assert( s < dtblsize );
|
||||
c = &connections[s];
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &c->c_mutex );
|
||||
if( c->c_struct_state == SLAP_C_UNINITIALIZED ) {
|
||||
doinit = 1;
|
||||
} else {
|
||||
@ -397,11 +405,6 @@ Connection * connection_init(
|
||||
|
||||
c->c_currentber = NULL;
|
||||
|
||||
/* should check status of thread calls */
|
||||
ldap_pvt_thread_mutex_init( &c->c_mutex );
|
||||
ldap_pvt_thread_mutex_init( &c->c_write1_mutex );
|
||||
ldap_pvt_thread_cond_init( &c->c_write1_cv );
|
||||
|
||||
#ifdef LDAP_SLAPI
|
||||
if ( slapi_plugins_used ) {
|
||||
slapi_int_create_object_extensions( SLAPI_X_EXT_CONNECTION, c );
|
||||
@ -409,8 +412,6 @@ Connection * connection_init(
|
||||
#endif
|
||||
}
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &c->c_mutex );
|
||||
|
||||
assert( BER_BVISNULL( &c->c_authmech ) );
|
||||
assert( BER_BVISNULL( &c->c_dn ) );
|
||||
assert( BER_BVISNULL( &c->c_ndn ) );
|
||||
|
Loading…
Reference in New Issue
Block a user