mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-08 08:02:16 -05:00
ITS#3527 fix race in bdb_idl_cache_get
This commit is contained in:
parent
122cdf4549
commit
f2d423e084
1 changed files with 4 additions and 4 deletions
|
|
@ -292,6 +292,7 @@ bdb_idl_cache_get(
|
|||
{
|
||||
bdb_idl_cache_entry_t idl_tmp;
|
||||
bdb_idl_cache_entry_t *matched_idl_entry;
|
||||
int rc = LDAP_NO_SUCH_OBJECT;
|
||||
|
||||
DBT2bv( key, &idl_tmp.kstr );
|
||||
idl_tmp.db = db;
|
||||
|
|
@ -301,19 +302,18 @@ bdb_idl_cache_get(
|
|||
if ( matched_idl_entry != NULL ) {
|
||||
if ( matched_idl_entry->idl && ids )
|
||||
BDB_IDL_CPY( ids, matched_idl_entry->idl );
|
||||
ldap_pvt_thread_rdwr_runlock( &bdb->bi_idl_tree_rwlock );
|
||||
ldap_pvt_thread_mutex_lock( &bdb->bi_idl_tree_lrulock );
|
||||
IDL_LRU_DELETE( bdb, matched_idl_entry );
|
||||
IDL_LRU_ADD( bdb, matched_idl_entry );
|
||||
ldap_pvt_thread_mutex_unlock( &bdb->bi_idl_tree_lrulock );
|
||||
if ( matched_idl_entry->idl )
|
||||
return LDAP_SUCCESS;
|
||||
rc = LDAP_SUCCESS;
|
||||
else
|
||||
return DB_NOTFOUND;
|
||||
rc = DB_NOTFOUND;
|
||||
}
|
||||
ldap_pvt_thread_rdwr_runlock( &bdb->bi_idl_tree_rwlock );
|
||||
|
||||
return LDAP_NO_SUCH_OBJECT;
|
||||
return rc;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue