]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#3288: use be_pcl_mutexp instead of be_pcl_mutex
authorHoward Chu <hyc@openldap.org>
Wed, 18 Aug 2004 10:53:34 +0000 (10:53 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Aug 2004 10:53:34 +0000 (10:53 +0000)
servers/slapd/backend.c
servers/slapd/ctxcsn.c
servers/slapd/slap.h

index a5933e7cb17b99bc4e1ed26d4f93593187b738f3..dfdfc4c50f8706767bc512ba287280204a814493 100644 (file)
@@ -644,7 +644,8 @@ backend_db_init(
 
        be->be_context_csn.bv_len = 0;
        be->be_context_csn.bv_val = NULL;
-       ldap_pvt_thread_mutex_init( &be->be_pcl_mutex );
+       be->be_pcl_mutexp = &be->be_pcl_mutex;
+       ldap_pvt_thread_mutex_init( be->be_pcl_mutexp );
        ldap_pvt_thread_mutex_init( &be->be_context_csn_mutex );
 
        LDAP_STAILQ_INIT( &be->be_syncinfo );
index c978ae90cfc28f9b728764a566564e0219581a96..b67fc7dff9061310325282065d5a9990d53e49da 100644 (file)
@@ -39,7 +39,7 @@ slap_get_commit_csn( Operation *op, struct berval *csn )
        csn->bv_val = NULL;
        csn->bv_len = 0;
 
-       ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
 
        LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
                if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
@@ -54,7 +54,7 @@ slap_get_commit_csn( Operation *op, struct berval *csn )
        }
 
        if ( committed_csne ) ber_dupbv_x( csn, committed_csne->ce_csn, op->o_tmpmemctx );
-       ldap_pvt_thread_mutex_unlock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
 }
 
 void
@@ -62,7 +62,7 @@ slap_rewind_commit_csn( Operation *op )
 {
        struct slap_csn_entry *csne;
 
-       ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
 
        LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
                if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
@@ -71,7 +71,7 @@ slap_rewind_commit_csn( Operation *op )
                }
        }
 
-       ldap_pvt_thread_mutex_unlock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
 }
 
 void
@@ -82,7 +82,7 @@ slap_graduate_commit_csn( Operation *op )
        if ( op == NULL ) return;
        if ( op->o_bd == NULL ) return;
 
-       ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
 
        LDAP_TAILQ_FOREACH( csne, op->o_bd->be_pending_csn_list, ce_csn_link ) {
                if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
@@ -95,7 +95,7 @@ slap_graduate_commit_csn( Operation *op )
                }
        }
 
-       ldap_pvt_thread_mutex_unlock( &op->o_bd->be_pcl_mutex );
+       ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
 
        return;
 }
@@ -160,7 +160,7 @@ slap_get_csn(
        if ( manage_ctxcsn ) {
                pending = (struct slap_csn_entry *) ch_calloc( 1,
                        sizeof( struct slap_csn_entry ));
-               ldap_pvt_thread_mutex_lock( &op->o_bd->be_pcl_mutex );
+               ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
                ber_dupbv( &op->o_sync_csn, csn );
                pending->ce_csn = ber_dupbv( NULL, csn );
                pending->ce_connid = op->o_connid;
@@ -168,7 +168,7 @@ slap_get_csn(
                pending->ce_state = SLAP_CSN_PENDING;
                LDAP_TAILQ_INSERT_TAIL( op->o_bd->be_pending_csn_list,
                        pending, ce_csn_link );
-               ldap_pvt_thread_mutex_unlock( &op->o_bd->be_pcl_mutex );
+               ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
        }
 
        return LDAP_SUCCESS;
index e7d66dd85d6a7787367f2bd6192c4d62af8c29de..690dab061a8ddbea919a49aadf8b0362a4ac5b04 100644 (file)
@@ -1581,6 +1581,7 @@ struct slap_backend_db {
        BerVarray       be_update_refs; /* where to refer modifying clients to */
        struct          be_pcl  *be_pending_csn_list;
        ldap_pvt_thread_mutex_t                                 be_pcl_mutex;
+       ldap_pvt_thread_mutex_t                                 *be_pcl_mutexp;
        struct berval                                                   be_context_csn;
        ldap_pvt_thread_mutex_t                                 be_context_csn_mutex;
        LDAP_STAILQ_HEAD( be_si, syncinfo_s )   be_syncinfo; /* For syncrepl */