Commit ea8a2894 authored by Howard Chu's avatar Howard Chu
Browse files

Free main-thread keys in db_close, can't do it later because the env

will be gone.
parent 8d039709
......@@ -1371,6 +1371,19 @@ bdb_locker_id_free( void *key, void *data )
}
}
/* free up any keys used by the main thread */
void
bdb_locker_flush( DB_ENV *env )
{
void *data;
void *ctx = ldap_pvt_thread_pool_context();
if ( !ldap_pvt_thread_pool_getkey( ctx, env, &data, NULL ) ) {
ldap_pvt_thread_pool_setkey( ctx, env, NULL, NULL );
bdb_locker_id_free( env, data );
}
}
int
bdb_locker_id( Operation *op, DB_ENV *env, u_int32_t *locker )
{
......
......@@ -494,7 +494,9 @@ bdb_db_close( BackendDB *be )
XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
bdb->bi_cache.c_locker = 0;
}
#ifdef BDB_REUSE_LOCKERS
bdb_locker_flush( bdb->bi_dbenv );
#endif
/* force a checkpoint, but not if we were ReadOnly,
* and not in Quick mode since there are no transactions there.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment