]> git.sur5r.net Git - openldap/commitdiff
ITS#5709 make sure CSNs are generated and queued atomically
authorHoward Chu <hyc@openldap.org>
Sat, 15 Nov 2008 08:49:44 +0000 (08:49 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 15 Nov 2008 08:49:44 +0000 (08:49 +0000)
servers/slapd/ctxcsn.c

index 23a54af7fd67508a4e8ffb488b714a250fe1ea6a..d2791557187c50e115ed600994ec0073cf9f640d 100644 (file)
@@ -192,10 +192,10 @@ slap_get_csn(
        /* gmtime doesn't always need a mutex, but lutil_csnstr does */
        ldap_pvt_thread_mutex_lock( &gmtime_mutex );
        csn->bv_len = lutil_csnstr( csn->bv_val, csn->bv_len, slap_serverID, 0 );
-       ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
-
        if ( manage_ctxcsn )
                slap_queue_csn( op, csn );
 
+       ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
+
        return LDAP_SUCCESS;
 }