Fix giant lock handling on entry release

This commit is contained in:
Kurt Zeilenga 2002-01-29 19:43:17 +00:00
parent b6de12f552
commit 7c6afdf7d1
2 changed files with 11 additions and 4 deletions

View File

@ -375,12 +375,14 @@ return_results:;
}
if ( rc ) {
/* in case of error, writer lock is freed
* and entry's private data is destroyed */
/*
* in case of error, writer lock is freed
* and entry's private data is destroyed.
* otherwise, this is done when entry is released
*/
cache_return_entry_w( &li->li_cache, e );
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
}
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
return( rc );
}

View File

@ -31,6 +31,11 @@ ldbm_back_entry_release_rw(
if ( slapMode == SLAP_SERVER_MODE ) {
/* free entry and reader or writer lock */
cache_return_entry_rw( &li->li_cache, e, rw );
if( rw ) {
ldap_pvt_thread_rdwr_wunlock( &li->li_giant_rwlock );
} else {
ldap_pvt_thread_rdwr_runlock( &li->li_giant_rwlock );
}
} else {
entry_free( e );