]> git.sur5r.net Git - openldap/commitdiff
Once more, mutex_lock -> trylock...
authorHoward Chu <hyc@openldap.org>
Thu, 5 Mar 2009 22:46:03 +0000 (22:46 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 5 Mar 2009 22:46:03 +0000 (22:46 +0000)
servers/slapd/syncrepl.c

index 8511fc4ddad29d3019e7da2f2a618a9e0cd55d65..7ad5c813ab76ea8a10c92108faf63184673ac47d 100644 (file)
@@ -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: