We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 560136b commit 826fdacCopy full SHA for 826fdac
heed/src/env.rs
@@ -473,6 +473,17 @@ impl Env {
473
}
474
475
476
+
477
+ /// Check for stale entries in the reader lock table and clear them.
478
+ ///
479
+ /// Returns the number of stale readers cleared.
480
+ pub fn clear_stale_readers(&self) -> Result<usize> {
481
+ let mut dead: i32 = 0;
482
+ unsafe { mdb_result(ffi::mdb_reader_check(self.0.env, &mut dead))? }
483
+ // safety: The reader_check function asks for an i32, initialize it to zero
484
+ // and never decrements it. It is safe to use either an u32 or u64 (usize).
485
+ Ok(dead as usize)
486
+ }
487
488
489
#[derive(Clone)]
heed/src/mdb/lmdb_ffi.rs
@@ -2,9 +2,9 @@ pub use ffi::{
2
mdb_cursor_close, mdb_cursor_del, mdb_cursor_get, mdb_cursor_open, mdb_cursor_put,
3
mdb_dbi_open, mdb_del, mdb_drop, mdb_env_close, mdb_env_copyfd2 as mdb_env_copy2fd,
4
mdb_env_create, mdb_env_open, mdb_env_set_mapsize, mdb_env_set_maxdbs, mdb_env_set_maxreaders,
5
- mdb_env_stat, mdb_env_sync, mdb_filehandle_t, mdb_get, mdb_put, mdb_stat, mdb_txn_abort,
6
- mdb_txn_begin, mdb_txn_commit, MDB_cursor, MDB_dbi, MDB_env, MDB_stat as MDB_Stat, MDB_txn,
7
- MDB_APPEND, MDB_CP_COMPACT, MDB_CREATE, MDB_CURRENT, MDB_RDONLY,
+ mdb_env_stat, mdb_env_sync, mdb_filehandle_t, mdb_get, mdb_put, mdb_reader_check, mdb_stat,
+ mdb_txn_abort, mdb_txn_begin, mdb_txn_commit, MDB_cursor, MDB_dbi, MDB_env,
+ MDB_stat as MDB_Stat, MDB_txn, MDB_APPEND, MDB_CP_COMPACT, MDB_CREATE, MDB_CURRENT, MDB_RDONLY,
8
};
9
use lmdb_master3_sys as ffi;
10
0 commit comments