An event that can be set/reset and that can be waited for. More...
#include <xsens_mutex.h>
Public Member Functions | |
void | reset () |
Reset the event. More... | |
void | set () |
Set the event. More... | |
void | terminate () |
Terminates the thread. More... | |
bool | wait () |
Wait for the event to be set or object termination. More... | |
WaitEvent () | |
~WaitEvent () | |
Private Member Functions | |
WaitEvent & | operator= (WaitEvent &&)=delete |
WaitEvent & | operator= (WaitEvent const &)=delete |
WaitEvent (WaitEvent &&)=delete | |
WaitEvent (WaitEvent const &)=delete | |
Private Attributes | |
pthread_cond_t | m_cond |
pthread_mutex_t | m_mutex |
volatile std::atomic_bool | m_terminating |
bool | m_triggered |
volatile std::atomic_int | m_waiterCount |
An event that can be set/reset and that can be waited for.
The WaitEvent is intended for 1-1 thread synchronization, not 1-N thread synchronization
Definition at line 1839 of file xsens_mutex.h.
|
privatedelete |
|
privatedelete |
xsens::WaitEvent::WaitEvent | ( | ) |
Definition at line 1100 of file threading.cpp.
xsens::WaitEvent::~WaitEvent | ( | ) |
Definition at line 1109 of file threading.cpp.
void xsens::WaitEvent::reset | ( | ) |
Reset the event.
Any wait() call will block until set() or terminate() is called.
Definition at line 1148 of file threading.cpp.
void xsens::WaitEvent::set | ( | ) |
Set the event.
Waiting items will (all) be notified and allowed to run
Definition at line 1136 of file threading.cpp.
void xsens::WaitEvent::terminate | ( | ) |
Terminates the thread.
Definition at line 1162 of file threading.cpp.
bool xsens::WaitEvent::wait | ( | ) |
Wait for the event to be set or object termination.
Definition at line 1119 of file threading.cpp.
|
private |
Definition at line 1860 of file xsens_mutex.h.
|
private |
Definition at line 1859 of file xsens_mutex.h.
|
private |
Definition at line 1864 of file xsens_mutex.h.
|
private |
Definition at line 1861 of file xsens_mutex.h.
|
private |
Definition at line 1863 of file xsens_mutex.h.