From 00abac7504bdfdd9bd09d8e8c19eeac155deedc6 Mon Sep 17 00:00:00 2001 From: Stanislav Tkach Date: Mon, 31 Aug 2020 10:03:10 +0300 Subject: [PATCH] Add DB::cancel_all_background_work method (#459) --- CHANGELOG.md | 2 ++ src/db.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b603a1..8f77d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] +* Add `DB::cancel_all_background_work` method (stanislav-tkach) + ## 0.15.0 (2020-08-25) * Fix building rocksdb library on windows host (aleksuss) diff --git a/src/db.rs b/src/db.rs index 38b84ca..9443146 100644 --- a/src/db.rs +++ b/src/db.rs @@ -1361,6 +1361,13 @@ impl DB { Ok(()) } } + + /// Request stopping background work, if wait is true wait until it's done. + pub fn cancel_all_background_work(&self, wait: bool) { + unsafe { + ffi::rocksdb_cancel_all_background_work(self.inner, wait as u8); + } + } } impl Drop for DB {