[unittests] ThreadPool: Remove redundant loop, NFC
[oota-llvm.git] / unittests / Support / ThreadPool.cpp
index 80b89e3c0ab30c80347e434c58ad7f63a324cdde..b0307d1f16a4eb145e6697d99b26cb2a7dfc01ce 100644 (file)
@@ -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.