27class ConditionVariable
final {
32 ConditionVariable(
const ConditionVariable&) =
delete;
33 ConditionVariable(ConditionVariable&&) =
delete;
34 ConditionVariable& operator=(
const ConditionVariable&) =
delete;
35 ConditionVariable& operator=(ConditionVariable&&) =
delete;
45 template <
typename Predicate>
46 [[nodiscard]]
bool Wait(std::unique_lock<Mutex>& lock, Predicate&& predicate);
53 template <
typename Rep,
typename Period>
54 CvStatus WaitFor(std::unique_lock<Mutex>& lock, std::chrono::duration<Rep, Period> timeout);
59 template <
typename Rep,
typename Period,
typename Predicate>
60 bool WaitFor(std::unique_lock<Mutex>& lock, std::chrono::duration<Rep, Period> timeout, Predicate&& predicate);
67 template <
typename Clock,
typename Duration>
68 CvStatus WaitUntil(std::unique_lock<Mutex>& lock, std::chrono::time_point<Clock, Duration> until);
80 template <
typename Clock,
typename Duration,
typename Predicate>
82 WaitUntil(std::unique_lock<Mutex>& lock, std::chrono::time_point<Clock, Duration> until, Predicate&& predicate);
87 template <
typename Predicate>
88 bool WaitUntil(std::unique_lock<Mutex>& lock, Deadline deadline, Predicate&& predicate);
97 impl::ConditionVariableAny<Mutex> impl_;
112 std::unique_lock<Mutex>& lock,
113 std::chrono::duration<Rep, Period> timeout,
114 Predicate&& predicate
116 return WaitUntil(lock, Deadline::FromDuration(timeout), std::forward<Predicate>(predicate));
126 std::unique_lock<Mutex>& lock,
127 std::chrono::time_point<Clock, Duration> until,
128 Predicate&& predicate
130 return WaitUntil(lock, Deadline::FromTimePoint(until), std::forward<Predicate>(predicate));