}
}
+/* 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 )
{
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.
*/