Synchronization primitive useful for waking a worker after a number of other things complete. More...
#include <CompletionEvent.hpp>
Public Member Functions | |
CompletionEvent (int64_t count=0) | |
int64_t | get_count () const |
void | enroll (int64_t inc=1) |
void | complete (int64_t decr=1) |
Decrement count once, if count == 0, wake all waiters. More... | |
void | wait () |
void | wait (SuspendedDelegate *c) |
void | reset () |
void | send_completion (Core origin, int64_t decr=1) |
Protected Attributes | |
ConditionVariable | cv |
int64_t | count |
Synchronization primitive useful for waking a worker after a number of other things complete.
All waiting tasks will be woken as soon as the count goes to 0. Use enroll()
to add more tasks.
Fulfills the ConditionVariable type_trait.
Definition at line 45 of file CompletionEvent.hpp.
|
inline |
Definition at line 50 of file CompletionEvent.hpp.
|
inline |
Decrement count once, if count == 0, wake all waiters.
Definition at line 59 of file CompletionEvent.hpp.
|
inline |
Definition at line 54 of file CompletionEvent.hpp.
|
inline |
Definition at line 52 of file CompletionEvent.hpp.
|
inline |
Definition at line 84 of file CompletionEvent.hpp.
|
inline |
Definition at line 69 of file CompletionEvent.hpp.
|
inline |
Definition at line 75 of file CompletionEvent.hpp.
|
protected |
Definition at line 48 of file CompletionEvent.hpp.
|
protected |
Definition at line 47 of file CompletionEvent.hpp.