EtcPal
HEAD (unstable)
ETC Platform Abstraction Layer (EtcPal)
|
View other versions:
|
A wrapper class for the EtcPal signal type.
Example usage:
The output of the above would be:
See signal (Signals) for more information.
Public Member Functions | |
Signal () | |
Create a new signal. | |
~Signal () | |
Destroy the signal. | |
Signal (const Signal &other)=delete | |
Signal & | operator= (const Signal &other)=delete |
Signal (Signal &&other)=delete | |
Signal & | operator= (Signal &&other)=delete |
bool | Wait () |
Wait for the signal. More... | |
bool | TryWait (int timeout_ms=0) |
Wait for the signal until either it is received or a timeout expires. More... | |
void | Notify () |
Notify those waiting on the signal. More... | |
void | NotifyFromIsr () |
Notify those waiting on the signal from an interrupt context. More... | |
etcpal_signal_t & | get () |
Get a reference to the underlying etcpal_signal_t type. | |
|
inline |
Notify those waiting on the signal.
See etcpal_signal_post().
|
inline |
Notify those waiting on the signal from an interrupt context.
NOTE: Only meaningful on some platforms. See the table in signal (Signals) and etcpal_signal_post_from_isr() for more information. On platforms on which it is not meaningful, executes the equivalent of Notify().
|
inline |
Wait for the signal until either it is received or a timeout expires.
NOTE: Timeouts other than 0 or ETCPAL_WAIT_FOREVER are typically only honored on real-time platforms. See the table in signal (Signals) for more information. On platforms where timeouts are not honored, passing 0 for timeout_ms returns immediately whether the signal is in the signaled or unsignaled state, while any other value executes the equivalent of Wait().
timeout_ms | How long to wait for the signal, in milliseconds. |
|
inline |
Wait for the signal.