From: Howard Chu Date: Sun, 26 Aug 2007 13:49:35 +0000 (+0000) Subject: Just use read locks on the entry_db_lock X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~76 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ddc5c9f735fe4cb212f13c38e2922d5c07e9ca7e;p=openldap Just use read locks on the entry_db_lock --- diff --git a/servers/slapd/back-bdb/cache.c b/servers/slapd/back-bdb/cache.c index c6d48112ce..9854a5656e 100644 --- a/servers/slapd/back-bdb/cache.c +++ b/servers/slapd/back-bdb/cache.c @@ -843,7 +843,7 @@ load1: bdb_cache_entryinfo_unlock( *eip ); islocked = 0; } - rc = bdb_cache_entry_db_lock( bdb, locker, *eip, load, 0, lock ); + rc = bdb_cache_entry_db_lock( bdb, locker, *eip, 0, 0, lock ); if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) { rc = DB_NOTFOUND; bdb_cache_entry_db_unlock( bdb, lock ); @@ -864,11 +864,7 @@ load1: ep = NULL; bdb_cache_lru_link( bdb, *eip ); } - if ( rc == 0 ) { - /* If we succeeded, downgrade back to a readlock. */ - rc = bdb_cache_entry_db_relock( bdb, locker, - *eip, 0, 0, lock ); - } else { + if ( rc ) { /* Otherwise, release the lock. */ bdb_cache_entry_db_unlock( bdb, lock ); }