aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ThreadPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/ThreadPool.cpp')
-rw-r--r--llvm/unittests/Support/ThreadPool.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp
index 80b89e3c..b0307d1 100644
--- a/llvm/unittests/Support/ThreadPool.cpp
+++ b/llvm/unittests/Support/ThreadPool.cpp
@@ -57,10 +57,8 @@ protected:
/// Make sure this thread not progress faster than the main thread.
void waitForMainThread() {
- while (!MainThreadReady) {
- std::unique_lock<std::mutex> LockGuard(WaitMainThreadMutex);
- WaitMainThread.wait(LockGuard, [&] { return MainThreadReady; });
- }
+ std::unique_lock<std::mutex> LockGuard(WaitMainThreadMutex);
+ WaitMainThread.wait(LockGuard, [&] { return MainThreadReady; });
}
/// Set the readiness of the main thread.