summaryrefslogtreecommitdiff
path: root/src/support/threads.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-04-15 20:48:57 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-04-18 11:19:41 -0700
commit60f1c1516df1218b37f1cd2caba847c48ba93f67 (patch)
tree8f3fd7778122c501b697c1b9945b7795a62b3d48 /src/support/threads.cpp
parent1b1df06741db2368ed05d7589b5588edfeb68fae (diff)
downloadbinaryen-60f1c1516df1218b37f1cd2caba847c48ba93f67.tar.gz
binaryen-60f1c1516df1218b37f1cd2caba847c48ba93f67.tar.bz2
binaryen-60f1c1516df1218b37f1cd2caba847c48ba93f67.zip
fix ThreadPool::size, we don't have any thread objects created if there is just one core, since then we run it all on the main thread anyhow
Diffstat (limited to 'src/support/threads.cpp')
-rw-r--r--src/support/threads.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/support/threads.cpp b/src/support/threads.cpp
index 2f558d051..e67e7dedb 100644
--- a/src/support/threads.cpp
+++ b/src/support/threads.cpp
@@ -155,7 +155,7 @@ void ThreadPool::work(std::vector<std::function<ThreadWorkState ()>>& doWorkers)
}
size_t ThreadPool::size() {
- return threads.size();
+ return std::max(size_t(1), threads.size());
}
bool ThreadPool::isRunning() {