1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
11 // <condition_variable>
13 // class condition_variable;
18 #include <condition_variable>
23 #include "make_test_thread.h"
24 #include "test_macros.h"
26 std::condition_variable cv
;
33 std::atomic
<int> ready_count(0);
37 std::unique_lock
<std::mutex
> lk(mut
);
48 std::unique_lock
<std::mutex
> lk(mut
);
59 std::thread t1
= support::make_test_thread(f1
);
60 std::thread t2
= support::make_test_thread(f2
);
61 while (ready_count
.load() != 2) {
62 std::this_thread::sleep_for(std::chrono::milliseconds(100));
65 std::unique_lock
<std::mutex
>lk(mut
);
71 std::this_thread::sleep_for(std::chrono::milliseconds(100));
72 std::unique_lock
<std::mutex
>lk(mut
);