condition variable class.
More...
#include <condition.hpp>
|
| | Condition () |
| | default constructor.
|
| |
| | Condition (const Condition &other)=delete |
| | copy constructor.
|
| |
| Condition & | operator= (const Condition &other)=delete |
| | copy assignment.
|
| |
| | Condition (Condition &&other)=delete |
| | move constructor.
|
| |
| Condition & | operator= (Condition &&other)=delete |
| | move assignment.
|
| |
| | ~Condition () |
| | destroys the mutex object.
|
| |
| void | signal () noexcept |
| | unblocks one of the waiting threads.
|
| |
| void | broadcast () noexcept |
| | unblocks all threads currently waiting.
|
| |
| template<class Lock > |
| void | wait (Lock &lock) |
| | wait on a condition.
|
| |
| template<class Lock , class Predicate > |
| void | wait (Lock &lock, Predicate pred) |
| | wait on a condition with predicate.
|
| |
| template<class Lock , class Rep , class Period > |
| bool | timedWait (Lock &lock, std::chrono::duration< Rep, Period > timeout) |
| | wait on a condition until timeout expire.
|
| |
| template<class Lock , class Rep , class Period , class Predicate > |
| bool | timedWait (Lock &lock, std::chrono::duration< Rep, Period > timeout, Predicate pred) |
| | wait on a condition with predicate until timeout expire.
|
| |
condition variable class.
◆ Condition() [1/3]
◆ Condition() [2/3]
| join::Condition::Condition |
( |
const Condition & | other | ) |
|
|
delete |
copy constructor.
- Parameters
-
| other | other object to copy. |
◆ Condition() [3/3]
| join::Condition::Condition |
( |
Condition && | other | ) |
|
|
delete |
move constructor.
- Parameters
-
| other | other object to move. |
◆ ~Condition()
| Condition::~Condition |
( |
| ) |
|
destroys the mutex object.
◆ broadcast()
| void Condition::broadcast |
( |
| ) |
|
|
noexcept |
unblocks all threads currently waiting.
◆ operator=() [1/2]
move assignment.
- Parameters
-
| other | other object to move. |
- Returns
- a reference to the current object.
◆ operator=() [2/2]
copy assignment.
- Parameters
-
| other | other object to copy. |
- Returns
- a reference to the current object.
◆ signal()
| void Condition::signal |
( |
| ) |
|
|
noexcept |
unblocks one of the waiting threads.
◆ timedWait() [1/2]
template<class Lock , class Rep , class Period >
| bool join::Condition::timedWait |
( |
Lock & | lock, |
|
|
std::chrono::duration< Rep, Period > | timeout ) |
|
inline |
wait on a condition until timeout expire.
- Parameters
-
| lock | mutex previously locked by the calling thread. |
| timeout | timeout. |
- Returns
- true on success, false on timeout.
◆ timedWait() [2/2]
template<class Lock , class Rep , class Period , class Predicate >
| bool join::Condition::timedWait |
( |
Lock & | lock, |
|
|
std::chrono::duration< Rep, Period > | timeout, |
|
|
Predicate | pred ) |
|
inline |
wait on a condition with predicate until timeout expire.
- Parameters
-
| lock | mutex previously locked by the calling thread. |
| timeout | timeout. |
| pred | predicate. |
- Returns
- true on success, false on timeout.
◆ wait() [1/2]
template<class Lock >
| void join::Condition::wait |
( |
Lock & | lock | ) |
|
|
inline |
wait on a condition.
- Parameters
-
| lock | mutex previously locked by the calling thread. |
◆ wait() [2/2]
template<class Lock , class Predicate >
| void join::Condition::wait |
( |
Lock & | lock, |
|
|
Predicate | pred ) |
|
inline |
wait on a condition with predicate.
- Parameters
-
| lock | mutex previously locked by the calling thread. |
| pred | predicate. |
The documentation for this class was generated from the following files: