5#include <condition_variable>
28 template <
typename Clock,
typename Duration>
30 const std::chrono::time_point<Clock, Duration>& time_point) {
31 return WaitImpl(lock, time_point);
34 template <
typename Clock,
typename Duration,
typename Predicate>
35 bool wait_until(std::unique_lock<yaclib::detail::fiber::Mutex>& lock,
37 return WaitImplWithPredicate(lock, time_point,
predicate);
40 template <
typename Rep,
typename Period>
42 const std::chrono::duration<Rep, Period>& duration) {
43 return WaitImpl(lock, duration);
46 template <
typename Rep,
typename Period,
typename Predicate>
47 bool wait_for(std::unique_lock<yaclib::detail::fiber::Mutex>& lock,
49 return WaitImplWithPredicate(lock, duration,
predicate);
57 template <
typename Timeout,
typename Predicate>
58 bool WaitImplWithPredicate(std::unique_lock<yaclib::detail::fiber::Mutex>& lock,
const Timeout&
timeout,
65 if constexpr (!std::is_same_v<Timeout, NoTimeoutTag>) {
73 template <
typename Timeout>
void wait(std::unique_lock< yaclib::detail::fiber::Mutex > &lock) noexcept
WaitStatus wait_for(std::unique_lock< yaclib::detail::fiber::Mutex > &lock, const std::chrono::duration< Rep, Period > &duration)
native_handle_type native_handle()
WaitStatus wait_until(std::unique_lock< yaclib::detail::fiber::Mutex > &lock, const std::chrono::time_point< Clock, Duration > &time_point)
bool wait_until(std::unique_lock< yaclib::detail::fiber::Mutex > &lock, const std::chrono::time_point< Clock, Duration > &time_point, Predicate predicate)
ConditionVariable() noexcept=default
bool wait_for(std::unique_lock< yaclib::detail::fiber::Mutex > &lock, const std::chrono::duration< Rep, Period > &duration, Predicate predicate)
void notify_one() noexcept
void notify_all() noexcept
std::condition_variable::native_handle_type native_handle_type
WaitStatus Wait(NoTimeoutTag)
#define YACLIB_DEBUG(cond, message)
void InjectFault() noexcept
Contract< V, E > MakeContract()
Creates related future and promise.