}
+// periodically called for maintenance
+void bdb_tick(void) {
+ int ret;
+ int rejected;
+
+ ret = bdb_env->lock_detect(bdb_env, 0, DB_LOCK_DEFAULT, &rejected);
+ if (ret) {
+ syslog(LOG_ERR, "bdb: lock_detect: %s", db_strerror(ret));
+ }
+ else if (rejected) {
+ syslog(LOG_DEBUG, "bdb: rejected lock %d", rejected);
+ bdb_abort(); // FIXME remove this, we want to unlock, not abort
+ }
+
+ syslog(LOG_DEBUG, "bdb: tick...");
+}
+
+
// Calling this function activates the Berkeley DB back end.
void bdb_init_backend(void) {
cdb_end_transaction = bdb_end_transaction;
cdb_check_handles = bdb_check_handles;
cdb_trunc = bdb_trunc;
+ cdb_tick = bdb_tick;
// Some functions in this backend need to store some per-thread data.
// We crerate the key here, during module initialization.