using write lock in accessing pslist

This commit is contained in:
Jong Hyuk Choi 2004-06-23 02:07:12 +00:00
parent 81c59404e9
commit bc6b28a650
4 changed files with 12 additions and 12 deletions

View File

@ -495,13 +495,13 @@ retry: /* transaction retry */
}
if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
assert( BEI(e) );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e,
LDAP_PSEARCH_BY_ADD );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {

View File

@ -561,11 +561,11 @@ retry: /* transaction retry */
}
if ( rs->sr_err == LDAP_SUCCESS && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
rs->sr_err = TXN_COMMIT( ltid, 0 );

View File

@ -530,11 +530,11 @@ retry: /* transaction retry */
}
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
if( op->o_preread ) {
@ -676,11 +676,10 @@ retry: /* transaction retry */
if ( rs->sr_err == LDAP_SUCCESS ) {
/* Loop through in-scope entries for each psearch spec */
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
bdb_psearch(op, rs, pm_list->ps_op,
@ -690,6 +689,7 @@ retry: /* transaction retry */
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
rs->sr_err = TXN_COMMIT( ltid, 0 );

View File

@ -888,11 +888,11 @@ retry: /* transaction retry */
}
if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop && !op->o_no_psearch ) {
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
/* modify entry */
@ -1034,11 +1034,10 @@ retry: /* transaction retry */
if ( rs->sr_err == LDAP_SUCCESS ) {
/* Loop through in-scope entries for each psearch spec */
ldap_pvt_thread_rdwr_rlock( &bdb->bi_pslist_rwlock );
ldap_pvt_thread_rdwr_wlock( &bdb->bi_pslist_rwlock );
LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_MODIFY );
}
ldap_pvt_thread_rdwr_runlock( &bdb->bi_pslist_rwlock );
pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
while ( pm_list != NULL ) {
bdb_psearch(op, rs, pm_list->ps_op,
@ -1048,6 +1047,7 @@ retry: /* transaction retry */
pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
}
ldap_pvt_thread_rdwr_wunlock( &bdb->bi_pslist_rwlock );
}
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {