CTRE Phoenix Pro C++ 23.0.12
|
Reference-counted Manual Event. More...
#include <ctre/phoenix/threading/RcManualEvent.hpp>
Public Member Functions | |
bool | WaitForSignal (int timeoutMs) const |
Wait for event to be signaled, or for timeout. More... | |
void | Signal () |
Signal the event. More... | |
void | Clear () |
Clear the event. More... | |
void | Reset () |
Reset the event signal to 0 without signaling other threads. More... | |
Reference-counted Manual Event.
Each Signal() increments a reference count, and each Clear() decrements the count. The event is signaled while the count is greater than 0.
This is useful for a situation where multiple threads signal an operation to run, and the operation should not stop until all threads clear the event.
void ctre::phoenix::threading::RcManualEvent::Clear | ( | ) |
Clear the event.
Any threads waiting on WaitForSignal() will time out if this is the last thread to clear the signal.
void ctre::phoenix::threading::RcManualEvent::Reset | ( | ) |
Reset the event signal to 0 without signaling other threads.
void ctre::phoenix::threading::RcManualEvent::Signal | ( | ) |
Signal the event.
Any threads waiting on WaitForSignal() will return true. The caller must clear the signal once it is done, otherwise the reference count may never return to 0.
bool ctre::phoenix::threading::RcManualEvent::WaitForSignal | ( | int | timeoutMs | ) | const |
Wait for event to be signaled, or for timeout.