]> git.sur5r.net Git - openldap/commitdiff
In do_syncrepl, don't wait if a previous syncrepl thread is still running.
authorHoward Chu <hyc@openldap.org>
Tue, 12 Feb 2008 18:49:37 +0000 (18:49 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 12 Feb 2008 18:49:37 +0000 (18:49 +0000)
servers/slapd/syncrepl.c

index e5f732f446a2e58ae47d5819b2ffa5074b67ca60..1b008233b7c1f92ce6896dc1d0fbe9b2481594cb 100644 (file)
@@ -1158,7 +1158,9 @@ do_syncrepl(
        if ( si == NULL )
                return NULL;
 
-       ldap_pvt_thread_mutex_lock( &si->si_mutex );
+       /* Don't wait around if there's a previous session still running */
+       if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex ))
+               return NULL;
 
        switch( abs( si->si_type ) ) {
        case LDAP_SYNC_REFRESH_ONLY: