Fix ITS#3288: use be_pcl_mutexp instead of be_pcl_mutex

This commit is contained in:
Howard Chu 2004-08-18 10:53:34 +00:00
parent eb25111b9a
commit 77ba70be13
3 changed files with 11 additions and 9 deletions

View 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 );

View 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;

View 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 */