Commit bc278815 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

cut extraneous comparison in ThreadPoolExecutor::setNumThreads

Summary:
Closes: https://github.com/facebook/folly/issues/1700.

The comparison is always false and therefore dead. Remove it.

Reviewed By: philippv

Differential Revision: D33647863

fbshipit-source-id: c882f998d1bf7d53cdba0a2c8e82a809a6b5fc13
parent 6babc2e3
......@@ -203,12 +203,9 @@ void ThreadPoolExecutor::setNumThreads(size_t numThreads) {
}
if (active > numThreads) {
numThreadsToJoin = active - numThreads;
if (numThreadsToJoin > active - minthreads) {
numThreadsToJoin = active - minthreads;
}
assert(numThreadsToJoin <= active - minthreads);
ThreadPoolExecutor::removeThreads(numThreadsToJoin, false);
activeThreads_.store(
active - numThreadsToJoin, std::memory_order_relaxed);
activeThreads_.store(numThreads, std::memory_order_relaxed);
} else if (pending > 0 || !observers_.empty() || active < minthreads) {
size_t numToAdd = std::min(pending, numThreads - active);
if (!observers_.empty()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment