mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
ITS#7996 Use a separate mutex in ldap_int_initialize
This commit is contained in:
parent
c06dc95cf9
commit
b2f4cacd47
1 changed files with 9 additions and 7 deletions
|
|
@ -634,14 +634,14 @@ int ldap_int_stackguard;
|
|||
void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
|
||||
{
|
||||
#ifdef LDAP_R_COMPILE
|
||||
LDAP_PVT_MUTEX_FIRSTCREATE( gopts->ldo_mutex );
|
||||
#endif
|
||||
static ldap_pvt_thread_mutex_t init_mutex;
|
||||
LDAP_PVT_MUTEX_FIRSTCREATE( init_mutex );
|
||||
|
||||
LDAP_MUTEX_LOCK( &gopts->ldo_mutex );
|
||||
LDAP_MUTEX_LOCK( &init_mutex );
|
||||
#endif
|
||||
if ( gopts->ldo_valid == LDAP_INITIALIZED ) {
|
||||
/* someone else got here first */
|
||||
LDAP_MUTEX_UNLOCK( &gopts->ldo_mutex );
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
|
||||
ldap_int_error_init();
|
||||
|
|
@ -769,6 +769,8 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
|
|||
|
||||
openldap_ldap_init_w_env(gopts, NULL);
|
||||
|
||||
done:
|
||||
LDAP_MUTEX_UNLOCK( &gopts->ldo_mutex );
|
||||
done:;
|
||||
#ifdef LDAP_R_COMPILE
|
||||
LDAP_MUTEX_UNLOCK( &init_mutex );
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue