[unittests] ThreadPool: Remove redundant loop, NFC
authorVedant Kumar <vsk@apple.com>
Sat, 19 Dec 2015 09:54:27 +0000 (09:54 +0000)
committerVedant Kumar <vsk@apple.com>
Sat, 19 Dec 2015 09:54:27 +0000 (09:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256097 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/ThreadPool.cpp

index 80b89e3..b0307d1 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.