#include <completion_event.h>
Public Member Functions | |
| void | notify () |
| void | wait () const |
| bool | completed () const |
| template<class Rep , class Period > | |
| bool | waitFor (const std::chrono::duration< Rep, Period > &relTime) const |
| template<class Clock , class Duration > | |
| bool | waitUntil (const std::chrono::time_point< Clock, Duration > &absTime) const |
| void | reset () |
A class which can be used for one-time notify/wait scenarios. It is basically a way to signal to any waiting threads that some event has completed. There must be a single publisher thread and zero or more waiters on arbitrary threads. reset may be called to restart a sequence (e.g. after notify occurs and all waiters have successfully exited wait*).
Definition at line 29 of file completion_event.h.
|
inline |
Peek to see if the event has been notified in any thread
Definition at line 49 of file completion_event.h.
|
inline |
Notify any waiting threads that the event has completed. It is safe for this to be called before threads call wait.
Definition at line 35 of file completion_event.h.
|
inline |
Resets the event to "not-completed". This should not be called while an active wait*\/notify sequence is still currently in play.
Definition at line 79 of file completion_event.h.
|
inline |
Wait for another thread to notify
Definition at line 42 of file completion_event.h.
|
inline |
Wait for another thread to notify or for the relative timeout to expire, whichever is first.
Definition at line 60 of file completion_event.h.
|
inline |
Wait for another thread to notify or for the absolute timeout to expire, whichever is first.
Definition at line 71 of file completion_event.h.