X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=unittests%2FSupport%2FThreadPool.cpp;h=b0307d1f16a4eb145e6697d99b26cb2a7dfc01ce;hp=80b89e3c0ab30c80347e434c58ad7f63a324cdde;hb=9832f083b49eeee1cd079767c794f8b2e1c154d9;hpb=f99fc122ca1a64a31d7a0f9676f49cef1bb398dc diff --git a/unittests/Support/ThreadPool.cpp b/unittests/Support/ThreadPool.cpp index 80b89e3c0ab..b0307d1f16a 100644 --- a/unittests/Support/ThreadPool.cpp +++ b/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 LockGuard(WaitMainThreadMutex); - WaitMainThread.wait(LockGuard, [&] { return MainThreadReady; }); - } + std::unique_lock LockGuard(WaitMainThreadMutex); + WaitMainThread.wait(LockGuard, [&] { return MainThreadReady; }); } /// Set the readiness of the main thread.