Expose CancellAllBackgroundWork to C api (#6832)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/6832

Reviewed By: cheng-chang

Differential Revision: D21498186

Pulled By: riversand963

fbshipit-source-id: 66bb0d7c06af2bf0df3c6a09b61bca2fb81f2dd3
This commit is contained in:
Stanislav Tkach 2020-05-12 14:48:14 -07:00 committed by Facebook GitHub Bot
parent c384c08a4f
commit 70aaa9ceeb
3 changed files with 10 additions and 0 deletions

View File

@ -4456,6 +4456,10 @@ void rocksdb_approximate_memory_usage_destroy(rocksdb_memory_usage_t* usage) {
delete usage;
}
void rocksdb_cancel_all_background_work(rocksdb_t* db, unsigned char wait) {
CancelAllBackgroundWork(db->rep, wait);
}
} // end extern "C"
#endif // !ROCKSDB_LITE

View File

@ -1840,6 +1840,9 @@ int main(int argc, char** argv) {
CheckNoError(err);
}
StartPhase("cancel_all_background_work");
rocksdb_cancel_all_background_work(db, 1);
StartPhase("cleanup");
rocksdb_close(db);
rocksdb_options_destroy(options);

View File

@ -1803,6 +1803,9 @@ extern ROCKSDB_LIBRARY_API void
rocksdb_options_set_memtable_whole_key_filtering(rocksdb_options_t*,
unsigned char);
extern ROCKSDB_LIBRARY_API void rocksdb_cancel_all_background_work(
rocksdb_t* db, unsigned char wait);
#ifdef __cplusplus
} /* end extern "C" */
#endif