From: Howard Chu Date: Thu, 5 Mar 2009 22:46:03 +0000 (+0000) Subject: Once more, mutex_lock -> trylock... X-Git-Tag: ACLCHECK_0~738 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5947a1692dab5e7b7ce9033d0ff71d4ebe021e73;p=openldap Once more, mutex_lock -> trylock... --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 8511fc4dda..7ad5c813ab 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1258,8 +1258,11 @@ do_syncrepl( if ( si == NULL ) return NULL; - /* There will never be more than one instance active */ - ldap_pvt_thread_mutex_lock( &si->si_mutex ); + /* Don't get stuck here while a pause is initiated */ + while ( ldap_pvt_thread_mutex_trylock( &si->si_mutex )) { + if ( !ldap_pvt_thread_pool_pausecheck( &connection_pool )) + ldap_pvt_thread_yield(); + } switch( abs( si->si_type ) ) { case LDAP_SYNC_REFRESH_ONLY: