]> git.sur5r.net Git - openldap/commitdiff
ITS#5454 regular mutex lock is safe
authorHoward Chu <hyc@openldap.org>
Fri, 11 Apr 2008 12:12:06 +0000 (12:12 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 11 Apr 2008 12:12:06 +0000 (12:12 +0000)
servers/slapd/syncrepl.c

index 93ff10fc9bdfe333829b04aa287427106b34b905..161ff46b144c208b1c99da4e27a464710dc4696a 100644 (file)
@@ -1174,9 +1174,8 @@ do_syncrepl(
        if ( si == NULL )
                return NULL;
 
-       /* Don't wait around if there's a previous session still running */
-       if ( ldap_pvt_thread_mutex_trylock( &si->si_mutex ))
-               return NULL;
+       /* There will never be more than one instance active */
+       ldap_pvt_thread_mutex_lock( &si->si_mutex );
 
        switch( abs( si->si_type ) ) {
        case LDAP_SYNC_REFRESH_ONLY: