Unconditionalize gmtime_mutex, always use it when calling lutil_csnstr

This commit is contained in:
Howard Chu 2007-02-11 13:52:55 +00:00
parent ee2001ea4b
commit f2355e91e0
3 changed files with 5 additions and 11 deletions

View File

@ -182,13 +182,10 @@ slap_get_csn(
{
if ( csn == NULL ) return LDAP_OTHER;
#ifndef HAVE_GMTIME_R
/* gmtime doesn't always need a mutex, but lutil_csnstr does */
ldap_pvt_thread_mutex_lock( &gmtime_mutex );
#endif
csn->bv_len = lutil_csnstr( csn->bv_val, csn->bv_len, slap_serverID, 0 );
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
#endif
if ( manage_ctxcsn )
slap_queue_csn( op, csn );

View File

@ -65,9 +65,7 @@ struct berval NoAttrs = BER_BVC( LDAP_NO_ATTRS );
ldap_pvt_thread_pool_t connection_pool;
int connection_pool_max = SLAP_MAX_WORKER_THREADS;
int slap_tool_thread_max = 1;
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_t gmtime_mutex;
#endif
slap_counters_t slap_counters;
@ -160,9 +158,7 @@ slap_init( int mode, const char *name )
}
#endif /* SLAPD_MONITOR */
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_init( &gmtime_mutex );
#endif
slap_passwd_init();
rc = slap_sasl_init();

View File

@ -1186,8 +1186,11 @@ LDAP_SLAPD_F (int) module_load LDAP_P((
const char* file_name,
int argc, char *argv[] ));
LDAP_SLAPD_F (int) module_path LDAP_P(( const char* path ));
LDAP_SLAPD_F (int) module_unload LDAP_P(( const char* file_name ));
LDAP_SLAPD_F (void) *module_resolve LDAP_P((
LDAP_SLAPD_F (void *) module_handle LDAP_P(( const char* file_name ));
LDAP_SLAPD_F (void *) module_resolve LDAP_P((
const void *module, const char *name));
#endif /* SLAPD_MODULES */
@ -1844,9 +1847,7 @@ LDAP_SLAPD_V (int) slap_tool_thread_max;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) entry2str_mutex;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) replog_mutex;
#ifndef HAVE_GMTIME_R
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) gmtime_mutex;
#endif
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) ad_undef_mutex;
LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) oc_undef_mutex;