From 7eaae29f6fcba342376212901d59ab4fde77d37f Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sun, 7 Feb 1999 02:50:10 +0000 Subject: [PATCH] Fix cache asserts on entry writer locks. --- servers/slapd/back-ldbm/cache.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index 955d9c67a2..8d3e84d7e9 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -215,7 +215,7 @@ cache_add_entry_lock( /* XXX check for writer lock - should also check no readers pending */ #ifdef LDAP_DEBUG - assert(!ldap_pvt_thread_rdwr_active( &e->e_rdwr )); + assert(ldap_pvt_thread_rdwr_writers( &e->e_rdwr ) == 1); #endif /* delete from cache and lru q */ @@ -386,14 +386,14 @@ cache_delete_entry( Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry:\n", 0, 0, 0 ); + /* set cache mutex */ + ldap_pvt_thread_mutex_lock( &cache->c_mutex ); + /* XXX check for writer lock - should also check no readers pending */ #ifdef LDAP_DEBUG - assert(ldap_pvt_thread_rdwr_writers(&e->e_rdwr)); + assert(ldap_pvt_thread_rdwr_writers( &e->e_rdwr ) == 1); #endif - /* set cache mutex */ - ldap_pvt_thread_mutex_lock( &cache->c_mutex ); - rc = cache_delete_entry_internal( cache, e ); /* free cache mutex */ -- 2.39.5