mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
using write lock in accessing pslist
This commit is contained in:
parent
81c59404e9
commit
bc6b28a650
@ -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 ) {
|
||||
|
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -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 ) {
|
||||
|
Loading…
Reference in New Issue
Block a user