From: Kurt Zeilenga Date: Tue, 29 Jan 2002 19:43:17 +0000 (+0000) Subject: Fix giant lock handling on entry release X-Git-Tag: LDBM_POST_GIANT_RWLOCK~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c6afdf7d1805a598d3dc7beaf0e4cacea998601;p=openldap Fix giant lock handling on entry release --- diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 9baac81065..5cf93afd82 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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 ); } diff --git a/servers/slapd/back-ldbm/entry.c b/servers/slapd/back-ldbm/entry.c index f018d2b129..9e2cdc17f5 100644 --- a/servers/slapd/back-ldbm/entry.c +++ b/servers/slapd/back-ldbm/entry.c @@ -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 );