Index: libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp =================================================================== --- libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp +++ libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/adopt_lock.pass.cpp @@ -18,6 +18,7 @@ #include #include +#include "make_test_thread.h" #include "test_macros.h" std::mutex m; @@ -26,7 +27,10 @@ { m.lock(); std::lock_guard lg(m, std::adopt_lock); - assert(m.try_lock() == false); + std::thread t = support::make_test_thread([](){ + assert(m.try_lock() == false); + }); + t.join(); } m.lock(); Index: libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp =================================================================== --- libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp +++ libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp @@ -21,6 +21,7 @@ #include #include +#include "make_test_thread.h" #include "test_macros.h" std::mutex m; @@ -28,7 +29,10 @@ int main(int, char**) { { std::lock_guard lg(m); - assert(m.try_lock() == false); + std::thread t = support::make_test_thread([](){ + assert(m.try_lock() == false); + }); + t.join(); } m.lock();