Commit 877faea7 authored by Ondřej Kuzník's avatar Ondřej Kuzník Committed by Quanah Gibson-Mount
Browse files

ITS#7996 Use a separate mutex in ldap_int_initialize

parent 708916fb
...@@ -589,14 +589,14 @@ char * ldap_int_hostname = NULL; ...@@ -589,14 +589,14 @@ char * ldap_int_hostname = NULL;
void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
{ {
#ifdef LDAP_R_COMPILE #ifdef LDAP_R_COMPILE
LDAP_PVT_MUTEX_FIRSTCREATE( gopts->ldo_mutex ); static ldap_pvt_thread_mutex_t init_mutex;
#endif LDAP_PVT_MUTEX_FIRSTCREATE( init_mutex );
LDAP_MUTEX_LOCK( &gopts->ldo_mutex ); LDAP_MUTEX_LOCK( &init_mutex );
#endif
if ( gopts->ldo_valid == LDAP_INITIALIZED ) { if ( gopts->ldo_valid == LDAP_INITIALIZED ) {
/* someone else got here first */ /* someone else got here first */
LDAP_MUTEX_UNLOCK( &gopts->ldo_mutex ); goto done;
return;
} }
ldap_int_error_init(); ldap_int_error_init();
...@@ -718,6 +718,8 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl ) ...@@ -718,6 +718,8 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
openldap_ldap_init_w_env(gopts, NULL); openldap_ldap_init_w_env(gopts, NULL);
done: done:;
LDAP_MUTEX_UNLOCK( &gopts->ldo_mutex ); #ifdef LDAP_R_COMPILE
LDAP_MUTEX_UNLOCK( &init_mutex );
#endif
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment