]> git.sur5r.net Git - openldap/commitdiff
Use a separate mutex for the replication timestamp
authorHoward Chu <hyc@openldap.org>
Wed, 24 Dec 2003 14:32:33 +0000 (14:32 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 24 Dec 2003 14:32:33 +0000 (14:32 +0000)
servers/slapd/init.c
servers/slapd/proto-slap.h
servers/slapd/repl.c

index 6ab72623220e8579b275ff378ea5b78a3545cc0f..71c3477b51d679b3a1a060d240495d1184e07691 100644 (file)
@@ -91,6 +91,7 @@ ldap_pvt_thread_mutex_t       num_sent_mutex;
  */
 ldap_pvt_thread_mutex_t        entry2str_mutex;
 ldap_pvt_thread_mutex_t        replog_mutex;
+ldap_pvt_thread_mutex_t        repstamp_mutex;
 
 static const char* slap_name = NULL;
 int slapMode = SLAP_UNDEFINED_MODE;
@@ -142,6 +143,7 @@ slap_init( int mode, const char *name )
 
                        ldap_pvt_thread_mutex_init( &entry2str_mutex );
                        ldap_pvt_thread_mutex_init( &replog_mutex );
+                       ldap_pvt_thread_mutex_init( &repstamp_mutex );
                        ldap_pvt_thread_mutex_init( &num_ops_mutex );
                        ldap_pvt_thread_mutex_init( &num_sent_mutex );
 
index 11871540a4bb1c4e6ee28d4dda793a4b5dadf663..2334edef12d8f8cbb03ee820e5be9faeb0fbd7bc 100644 (file)
@@ -1246,6 +1246,7 @@ LDAP_SLAPD_V (int)                        connection_pool_max;
 
 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) entry2str_mutex;
 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) replog_mutex;
+LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) repstamp_mutex;
 
 #if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) passwd_mutex;
index eb20c6681e516fd54877b40ab72f8c3e921642f9..cb50ba6879c9dc825eefffd6e310963956f888c6 100644 (file)
@@ -129,7 +129,7 @@ replog1( struct slap_replica_info *ri, Operation *op, FILE *fp );
 void
 repstamp( Operation *op )
 {
-       ldap_pvt_thread_mutex_lock( &replog_mutex );
+       ldap_pvt_thread_mutex_lock( &repstamp_mutex );
        op->o_time = slap_get_time();
        if ( op->o_time == oldstamp.time ) {
                op->o_tseq = ++oldstamp.seq;
@@ -138,7 +138,7 @@ repstamp( Operation *op )
                oldstamp.seq = 0;
                op->o_tseq = 0;
        }
-       ldap_pvt_thread_mutex_unlock( &replog_mutex );
+       ldap_pvt_thread_mutex_unlock( &repstamp_mutex );
 }
 
 void