Skip to content

Commit

Permalink
export Env::Default()->SetBackgroundThreads(0, Env::Priority::LOW) a…
Browse files Browse the repository at this point in the history
…nd SetBackgroundThreads(n, Env::BOTTOM);
  • Loading branch information
developerfred committed Jul 29, 2020
1 parent f900f6b commit e1d4a84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3831,12 +3831,18 @@ void rocksdb_env_set_background_threads(rocksdb_env_t* env, int n) {
env->rep->SetBackgroundThreads(n);
}

void rocksdb_env_set_bottom_priority_background_threads(rocksdb_env_t* env,
int n) {
env->rep->SetBackgroundThreads(n, Env::BOTTOM);
}

void rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n) {
env->rep->SetBackgroundThreads(n, Env::HIGH);
}

void rocksdb_env_set_background_threads_disable(rocksdb_env_t* env, int n) {
env->rep->SetBackgroundThreads(n, Env::BOTTOM);
void rocksdb_env_set_low_priority_background_threads(rocksdb_env_t* env,
int n) {
env->rep->SetBackgroundThreads(n, Env::LOW);
}

void rocksdb_env_join_all_threads(rocksdb_env_t* env) {
Expand Down
4 changes: 3 additions & 1 deletion include/rocksdb/c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1555,8 +1555,10 @@ extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads(
rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void
rocksdb_env_set_high_priority_background_threads(rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_background_threads_disable(
extern ROCKSDB_LIBRARY_API void rocksdb_env_set_low_priority_background_threads(
rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void
rocksdb_env_set_bottom_priority_background_threads(rocksdb_env_t* env, int n);
extern ROCKSDB_LIBRARY_API void rocksdb_env_join_all_threads(
rocksdb_env_t* env);
extern ROCKSDB_LIBRARY_API void rocksdb_env_lower_thread_pool_io_priority(rocksdb_env_t* env);
Expand Down

0 comments on commit e1d4a84

Please sign in to comment.