From f2355e91e022de9eb348dd6b571c3f79471c9670 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 11 Feb 2007 13:52:55 +0000 Subject: [PATCH] Unconditionalize gmtime_mutex, always use it when calling lutil_csnstr --- servers/slapd/ctxcsn.c | 5 +---- servers/slapd/init.c | 4 ---- servers/slapd/proto-slap.h | 7 ++++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/servers/slapd/ctxcsn.c b/servers/slapd/ctxcsn.c index 58ee6d1ccd..c93fa5c83c 100644 --- a/servers/slapd/ctxcsn.c +++ b/servers/slapd/ctxcsn.c @@ -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 ); diff --git a/servers/slapd/init.c b/servers/slapd/init.c index d504a79228..3cff69e3e6 100644 --- a/servers/slapd/init.c +++ b/servers/slapd/init.c @@ -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(); diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index bbeda65ef3..c89c1eaa6d 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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;