CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix::threading::RcManualEvent Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ Clear()

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.

◆ Reset()

void ctre::phoenix::threading::RcManualEvent::Reset ( )

Reset the event signal to 0 without signaling other threads.

◆ Signal()

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.

◆ WaitForSignal()

bool ctre::phoenix::threading::RcManualEvent::WaitForSignal ( int  timeoutMs) const

Wait for event to be signaled, or for timeout.

Returns
true if event is signaled, false if timed out.

The documentation for this class was generated from the following file: