提交 47ed3bfc 编写于 作者: A Andrew Kryczka 提交者: Facebook Github Bot

fix WinEnv assertions

Summary: Closes https://github.com/facebook/rocksdb/pull/2702

Differential Revision: D5585389

Pulled By: ajkr

fbshipit-source-id: cb54041eb481d0d759c440f82a8a2c5b34534173
上级 d97a72d6
......@@ -829,7 +829,7 @@ WinEnvThreads::~WinEnvThreads() {
void WinEnvThreads::Schedule(void(*function)(void*), void* arg, Env::Priority pri,
void* tag, void(*unschedFunction)(void* arg)) {
assert(pri >= Env::Priority::LOW && pri <= Env::Priority::HIGH);
assert(pri >= Env::Priority::BOTTOM && pri <= Env::Priority::HIGH);
thread_pools_[pri].Schedule(function, arg, tag, unschedFunction);
}
......@@ -878,7 +878,7 @@ void WinEnvThreads::WaitForJoin() {
}
unsigned int WinEnvThreads::GetThreadPoolQueueLen(Env::Priority pri) const {
assert(pri >= Env::Priority::LOW && pri <= Env::Priority::HIGH);
assert(pri >= Env::Priority::BOTTOM && pri <= Env::Priority::HIGH);
return thread_pools_[pri].GetQueueLen();
}
......@@ -894,17 +894,17 @@ void WinEnvThreads::SleepForMicroseconds(int micros) {
}
void WinEnvThreads::SetBackgroundThreads(int num, Env::Priority pri) {
assert(pri >= Env::Priority::LOW && pri <= Env::Priority::HIGH);
assert(pri >= Env::Priority::BOTTOM && pri <= Env::Priority::HIGH);
thread_pools_[pri].SetBackgroundThreads(num);
}
int WinEnvThreads::GetBackgroundThreads(Env::Priority pri) {
assert(pri >= Env::Priority::LOW && pri <= Env::Priority::HIGH);
assert(pri >= Env::Priority::BOTTOM && pri <= Env::Priority::HIGH);
return thread_pools_[pri].GetBackgroundThreads();
}
void WinEnvThreads::IncBackgroundThreadsIfNeeded(int num, Env::Priority pri) {
assert(pri >= Env::Priority::LOW && pri <= Env::Priority::HIGH);
assert(pri >= Env::Priority::BOTTOM && pri <= Env::Priority::HIGH);
thread_pools_[pri].IncBackgroundThreadsIfNeeded(num);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册