summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/ThreadPool.cpp
diff options
context:
space:
mode:
authorJan Korous <jkorous@apple.com>2017-11-27 13:42:03 +0000
committerJan Korous <jkorous@apple.com>2017-11-27 13:42:03 +0000
commitc723f657094bedc5975ca298356ad280e161c491 (patch)
tree78fe387063df2288d52d3e4ce9b1b6ca4a18c664 /llvm/lib/Support/ThreadPool.cpp
parent2dfdfa28840c4ab5960fa31f4e16102f39a485ae (diff)
downloadbcm5719-llvm-c723f657094bedc5975ca298356ad280e161c491.tar.gz
bcm5719-llvm-c723f657094bedc5975ca298356ad280e161c491.zip
[Support] Fix locking of shared variable in threadpool
llvm-svn: 319027
Diffstat (limited to 'llvm/lib/Support/ThreadPool.cpp')
-rw-r--r--llvm/lib/Support/ThreadPool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/ThreadPool.cpp b/llvm/lib/Support/ThreadPool.cpp
index f1b5bdf40c3..d0212ca1346 100644
--- a/llvm/lib/Support/ThreadPool.cpp
+++ b/llvm/lib/Support/ThreadPool.cpp
@@ -47,8 +47,8 @@ ThreadPool::ThreadPool(unsigned ThreadCount)
// in order for wait() to properly detect that even if the queue is
// empty, there is still a task in flight.
{
- ++ActiveThreads;
std::unique_lock<std::mutex> LockGuard(CompletionLock);
+ ++ActiveThreads;
}
Task = std::move(Tasks.front());
Tasks.pop();
OpenPOWER on IntegriCloud