[llvm] r256097 - [unittests] ThreadPool: Remove redundant loop, NFC

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 19 01:54:27 PST 2015


Author: vedantk
Date: Sat Dec 19 03:54:27 2015
New Revision: 256097

URL: http://llvm.org/viewvc/llvm-project?rev=256097&view=rev
Log:
[unittests] ThreadPool: Remove redundant loop, NFC

Modified:
    llvm/trunk/unittests/Support/ThreadPool.cpp

Modified: llvm/trunk/unittests/Support/ThreadPool.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ThreadPool.cpp?rev=256097&r1=256096&r2=256097&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/ThreadPool.cpp (original)
+++ llvm/trunk/unittests/Support/ThreadPool.cpp Sat Dec 19 03:54:27 2015
@@ -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.




More information about the llvm-commits mailing list