From bdabc2f19ffb9e20600dad6e8a300842a7bda50e Mon Sep 17 00:00:00 2001 From: patrick Date: Fri, 6 Apr 2018 14:26:03 +0000 Subject: Import LLVM 6.0.1 release including clang, lld and lldb. "where is the kaboom?" deraadt@ --- gnu/llvm/lib/Support/ThreadPool.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gnu/llvm/lib/Support/ThreadPool.cpp') diff --git a/gnu/llvm/lib/Support/ThreadPool.cpp b/gnu/llvm/lib/Support/ThreadPool.cpp index 22b7550d497..d0212ca1346 100644 --- a/gnu/llvm/lib/Support/ThreadPool.cpp +++ b/gnu/llvm/lib/Support/ThreadPool.cpp @@ -14,14 +14,15 @@ #include "llvm/Support/ThreadPool.h" #include "llvm/Config/llvm-config.h" +#include "llvm/Support/Threading.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; #if LLVM_ENABLE_THREADS -// Default to std::thread::hardware_concurrency -ThreadPool::ThreadPool() : ThreadPool(std::thread::hardware_concurrency()) {} +// Default to hardware_concurrency +ThreadPool::ThreadPool() : ThreadPool(hardware_concurrency()) {} ThreadPool::ThreadPool(unsigned ThreadCount) : ActiveThreads(0), EnableFlag(true) { @@ -46,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 LockGuard(CompletionLock); + ++ActiveThreads; } Task = std::move(Tasks.front()); Tasks.pop(); -- cgit v1.2.3-59-g8ed1b