From 3c67248a651bce3ac4436630e4e468b3a774c740 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 26 Jan 1999 05:22:58 +0000 Subject: [PATCH] cache_set_state( cache, e, 0) cannot occur before lock on parent/root is released. Some other thread may have cache locked but blocking on parent. Must give up parent lock before acquiring cache lock. --- servers/slapd/back-ldbm/add.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 8e8316c196..28fdc31e7b 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -221,8 +221,6 @@ ldbm_back_add( rc = 0; return_results:; - cache_set_state( &li->li_cache, e, 0 ); - if (p != NULL) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); @@ -233,6 +231,8 @@ return_results:; pthread_mutex_unlock(&li->li_root_mutex); } + cache_set_state( &li->li_cache, e, 0 ); + /* free entry and writer lock */ cache_return_entry_w( &li->li_cache, e ); -- 2.39.5