ITS#6177 proposed fix, please test

This commit is contained in:
Howard Chu 2009-06-19 02:06:58 +00:00
parent 59a29c9801
commit 68e252c9a9

View File

@ -1336,7 +1336,7 @@ bdb_cache_delete(
DB_LOCK *lock )
{
EntryInfo *ei = BEI(e);
int rc;
int rc, busy = 0;
assert( e->e_private != NULL );
@ -1346,8 +1346,24 @@ bdb_cache_delete(
/* Set this early, warn off any queriers */
ei->bei_state |= CACHE_ENTRY_DELETED;
if (( ei->bei_state & ( CACHE_ENTRY_NOT_LINKED |
CACHE_ENTRY_LOADING | CACHE_ENTRY_ONELEVEL )) ||
ei->bei_finders > 0 )
busy = 1;
bdb_cache_entryinfo_unlock( ei );
while ( busy ) {
ldap_pvt_thread_yield();
busy = 0;
bdb_cache_entryinfo_lock( ei );
if (( ei->bei_state & ( CACHE_ENTRY_NOT_LINKED |
CACHE_ENTRY_LOADING | CACHE_ENTRY_ONELEVEL )) ||
ei->bei_finders > 0 )
busy = 1;
bdb_cache_entryinfo_unlock( ei );
}
/* Get write lock on the data */
rc = bdb_cache_entry_db_relock( bdb, txn, ei, 1, 0, lock );
if ( rc ) {