if ( ldap_pvt_thread_mutex_trylock(
&(*eip)->bei_kids_mutex )) {
ldap_pvt_thread_rdwr_runlock( &bdb->bi_cache.c_rwlock );
+ if ( (*eip)->bei_state & CACHE_ENTRY_DELETED ) {
+ return DB_NOTFOUND;
+ }
ldap_pvt_thread_yield();
goto again;
}
} else {
bdb_cache_entry_db_lock( bdb->bi_dbenv, locker,
*eip, 0, 0, lock );
-
if ( !(*eip)->bei_e ) {
if (!ep) {
rc = bdb_id2entry( op->o_bd, tid, id, &ep );
/* Set this early, warn off any queriers */
ei->bei_state |= CACHE_ENTRY_DELETED;
+ /* Lock the entry's info */
+ bdb_cache_entryinfo_lock( ei );
+
/* Get write lock on the data */
bdb_cache_entry_db_relock( env, locker, ei, 1, 0, lock );
/* free cache write lock */
ldap_pvt_thread_rdwr_wunlock( &cache->c_rwlock );
bdb_cache_entryinfo_unlock( ei->bei_parent );
+
+ /* Leave entry info locked */
+
return( rc );
}
Entry *e
)
{
+ bdb_cache_entryinfo_unlock( BEI(e) );
bdb_cache_entryinfo_destroy( e->e_private );
e->e_private = NULL;
bdb_entry_return( e );