Skip to content

Commit

Permalink
fix WinEnv assertions
Browse files Browse the repository at this point in the history
Summary: Closes facebook#2702

Differential Revision: D5585389

Pulled By: ajkr

fbshipit-source-id: cb54041eb481d0d759c440f82a8a2c5b34534173
  • Loading branch information
ajkr authored and facebook-github-bot committed Aug 9, 2017
1 parent d97a72d commit 47ed3bf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions port/win/env_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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();
}

Expand All @@ -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);
}

Expand Down

0 comments on commit 47ed3bf

Please sign in to comment.