Mercury Currency Engine
Classes | Public Member Functions | List of all members
mce::condition_variable Struct Reference

#include <condition_variable.hpp>

Public Member Functions

 condition_variable (condition_variable &&rhs)=delete
 
 condition_variable (const condition_variable &rhs)=delete
 
condition_variableoperator= (condition_variable &&rhs)=delete
 
condition_variableoperator= (const condition_variable &rhs)=delete
 
template<class Lock >
void wait (Lock &lk)
 
template<class Lock , class Pred >
void wait (Lock &lk, Pred p)
 
template<class Lock , class Rep , class Period >
std::cv_status wait_for (Lock &lk, const std::chrono::duration< Rep, Period > &d)
 
template<class Lock , class Rep , class Period , class Pred >
bool wait_for (Lock &lk, const std::chrono::duration< Rep, Period > &d, Pred p)
 
template<class Lock , class Clock , class Duration >
std::cv_status wait_until (Lock &user_lk, const std::chrono::time_point< Clock, Duration > &tp)
 
template<class Lock , class Clock , class Duration , class Pred >
void wait_until (Lock &lk, std::chrono::time_point< Clock, Duration > tp, Pred p)
 
void notify_one ()
 Unblock one context calling a wait operation.
 
void notify_all ()
 Unblock all contexts calling a wait operation.
 

Detailed Description

Condition variable class safe to use in both mce coroutines, normal threaded code, or any mixture of the two.

Member Function Documentation

◆ wait() [1/2]

template<class Lock >
void mce::condition_variable::wait ( Lock &  lk)
inline

Block until unpark is called for this blocker

◆ wait() [2/2]

template<class Lock , class Pred >
void mce::condition_variable::wait ( Lock &  lk,
Pred  p 
)
inline

Block until unpark is called for this blocker and predicate is satisfied

◆ wait_for() [1/2]

template<class Lock , class Rep , class Period >
std::cv_status mce::condition_variable::wait_for ( Lock &  lk,
const std::chrono::duration< Rep, Period > &  d 
)
inline

Block until unpark is called for this blocker or duration since start of the operation expires

◆ wait_for() [2/2]

template<class Lock , class Rep , class Period , class Pred >
bool mce::condition_variable::wait_for ( Lock &  lk,
const std::chrono::duration< Rep, Period > &  d,
Pred  p 
)
inline

Block until unpark is called for this blocker or duration since start of the operation expires

◆ wait_until() [1/2]

template<class Lock , class Clock , class Duration , class Pred >
void mce::condition_variable::wait_until ( Lock &  lk,
std::chrono::time_point< Clock, Duration >  tp,
Pred  p 
)
inline

Block until unpark is called for this blocker or until point in time is reached

◆ wait_until() [2/2]

template<class Lock , class Clock , class Duration >
std::cv_status mce::condition_variable::wait_until ( Lock &  user_lk,
const std::chrono::time_point< Clock, Duration > &  tp 
)
inline

Block until unpark is called for this blocker or until point in time is reached


The documentation for this struct was generated from the following file: