Skip to content

Commit

Permalink
[Support] Fix locking of shared variable in threadpool
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319027 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
jkorous-apple committed Nov 27, 2017
1 parent 14242fe commit 0c9555a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Support/ThreadPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0c9555a

Please sign in to comment.