Condition variable used to synchronize tasks. The tasks can be suspended on this condition variable and then later notify to resume if given condition is met.
More...
#include <coopsync_tbb/condition_variable.hpp>
|
|
| condition_variable ()=default |
| | Constructs a new condition variable.
|
|
| condition_variable (const condition_variable &)=delete |
| | The condition_variable is not copy-constructible.
|
|
condition_variable & | operator= (const condition_variable &)=delete |
| | The condition_variable is not copy-assignable.
|
|
| condition_variable (condition_variable &&)=delete |
| | THe condition_variable is not move-constructible.
|
|
condition_variable & | operator= (condition_variable &&)=delete |
| | The condition_variable is not move-assignable.
|
| | ~condition_variable () |
| | Destroys the condition variable.
|
|
void | notify_one () |
| | Resumes one task suspended waiting on this condition variable, if there is any.
|
|
void | notify_all () |
| | Resumes all tasks suspended waiting on this condition variable.
|
| template<typename Lock> |
| void | wait (Lock &lock) |
| | Suspends the calling task until it is notified.
|
| template<typename Lock, typename Pred> |
| void | wait (Lock &lock, Pred pred) |
| | Suspends the calling task until pred() becomes true.
|
Condition variable used to synchronize tasks. The tasks can be suspended on this condition variable and then later notify to resume if given condition is met.
◆ ~condition_variable()
| coopsync_tbb::condition_variable::~condition_variable |
( |
| ) |
|
Destroys the condition variable.
- Note
- The destructor must not be called while there are still tasks waiting on the condition variable. The destructor does not notify or resume any waiting tasks.
◆ wait() [1/2]
template<typename Lock>
| void coopsync_tbb::condition_variable::wait |
( |
Lock & | lock | ) |
|
|
inline |
Suspends the calling task until it is notified.
- Template Parameters
-
| Lock | A lock type providing lock() and unlock(). |
- Parameters
-
| lock | The lock to be released while waiting and reacquired after resumption. The lock must be in an locked state before calling this function. |
◆ wait() [2/2]
template<typename Lock, typename Pred>
| void coopsync_tbb::condition_variable::wait |
( |
Lock & | lock, |
|
|
Pred | pred ) |
|
inline |
Suspends the calling task until pred() becomes true.
- Template Parameters
-
| Lock | A lock type providing lock() and unlock(). |
| Pred | Callable returning bool. Must be invocable without arguments. |
- Parameters
-
| lock | The lock to be released while waiting and reacquired after resumption. The lock must be in an locked state before calling this function. |
| pred | The predicate to be evaluated after each resumption, if it returns false the task is suspended again. |
- Exceptions
-
| any | exception thrown by pred(). |
The documentation for this class was generated from the following file: