[llvm] r319027 - [Support] Fix locking of shared variable in threadpool
Jan Korous via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 27 05:42:03 PST 2017
Author: jkorous
Date: Mon Nov 27 05:42:03 2017
New Revision: 319027
URL: http://llvm.org/viewvc/llvm-project?rev=319027&view=rev
Log:
[Support] Fix locking of shared variable in threadpool
Modified:
llvm/trunk/lib/Support/ThreadPool.cpp
Modified: llvm/trunk/lib/Support/ThreadPool.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/ThreadPool.cpp?rev=319027&r1=319026&r2=319027&view=diff
==============================================================================
--- llvm/trunk/lib/Support/ThreadPool.cpp (original)
+++ llvm/trunk/lib/Support/ThreadPool.cpp Mon Nov 27 05:42:03 2017
@@ -47,8 +47,8 @@ ThreadPool::ThreadPool(unsigned ThreadCo
// 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();
More information about the llvm-commits
mailing list