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
12 // <condition_variable>
14 // class condition_variable_any;
16 // template <class Lock, class Predicate>
17 // void wait(Lock& lock, Predicate pred);
19 #include <condition_variable>
25 #include "make_test_thread.h"
26 #include "test_macros.h"
28 std::condition_variable_any cv
;
30 typedef std::timed_mutex L0
;
31 typedef std::unique_lock
<L0
> L1
;
42 explicit Pred(int& i
) : i_(i
) {}
44 bool operator()() {return i_
!= 0;}
53 cv
.wait(lk
, Pred(test2
));
60 std::thread t
= support::make_test_thread(f
);