Alarm primitive used to wait for and raise shutdown-style signals.
More...
#include <src/thread_safe.h>
|
|
void | reset () |
| | Reset the object to its initial empty state.
|
| |
| void | ring (const status_t &status) |
| | Mark the alarm as rung and wake waiting threads.
|
| |
| void | ring (status_t &&status) |
| | Mark the alarm as rung and wake waiting threads.
|
| |
| status_t & | status () |
| | Return or update the current status value.
|
| |
| const status_t & | status () const |
| | Return or update the current status value.
|
| |
| auto | wait () |
| | Block until the event is raised.
|
| |
| template<class Pred > |
| auto | wait (Pred &&pred) |
| | Block until the event is raised and the predicate accepts the state.
|
| |
| template<class Rep , class Period > |
| auto | wait_for (const std::chrono::duration< Rep, Period > &rel_time) |
| | Wait for for.
|
| |
| template<class Rep , class Period , class Pred > |
| auto | wait_for (const std::chrono::duration< Rep, Period > &rel_time, Pred &&pred) |
| | Wait for for.
|
| |
| template<class Rep , class Period > |
| auto | wait_until (const std::chrono::duration< Rep, Period > &rel_time) |
| | Wait for until.
|
| |
| template<class Rep , class Period , class Pred > |
| auto | wait_until (const std::chrono::duration< Rep, Period > &rel_time, Pred &&pred) |
| | Wait for until.
|
| |
template<class T>
class safe::alarm_raw_t< T >
Alarm primitive used to wait for and raise shutdown-style signals.
◆ ring() [1/2]
Mark the alarm as rung and wake waiting threads.
- Parameters
-
| status | Native status code returned by the platform API. |
◆ ring() [2/2]
Mark the alarm as rung and wake waiting threads.
- Parameters
-
| status | Native status code returned by the platform API. |
◆ status() [1/2]
Return or update the current status value.
- Returns
- Status status.
◆ status() [2/2]
Return or update the current status value.
- Returns
- Status status.
◆ wait() [1/2]
Block until the event is raised.
- Returns
- Lock object held after the event is observed.
◆ wait() [2/2]
template<class T >
template<class Pred >
Block until the event is raised and the predicate accepts the state.
- Parameters
-
| pred | Predicate used to decide whether the wait is complete. |
- Returns
- Lock object held after the predicate succeeds.
◆ wait_for() [1/2]
template<class T >
template<class Rep , class Period >
| auto safe::alarm_raw_t< T >::wait_for |
( |
const std::chrono::duration< Rep, Period > & | rel_time | ) |
|
|
inline |
Wait for for.
- Parameters
-
- Returns
- Wait result indicating whether the condition was satisfied before timeout.
◆ wait_for() [2/2]
template<class T >
template<class Rep , class Period , class Pred >
| auto safe::alarm_raw_t< T >::wait_for |
( |
const std::chrono::duration< Rep, Period > & | rel_time, |
|
|
Pred && | pred ) |
|
inline |
Wait for for.
- Parameters
-
| rel_time | Rel time. |
| pred | Predicate used to decide whether the wait is complete. |
- Returns
- Wait result indicating whether the condition was satisfied before timeout.
◆ wait_until() [1/2]
template<class T >
template<class Rep , class Period >
| auto safe::alarm_raw_t< T >::wait_until |
( |
const std::chrono::duration< Rep, Period > & | rel_time | ) |
|
|
inline |
Wait for until.
- Parameters
-
- Returns
- Wait result indicating whether the condition was satisfied before the deadline.
◆ wait_until() [2/2]
template<class T >
template<class Rep , class Period , class Pred >
| auto safe::alarm_raw_t< T >::wait_until |
( |
const std::chrono::duration< Rep, Period > & | rel_time, |
|
|
Pred && | pred ) |
|
inline |
Wait for until.
- Parameters
-
| rel_time | Rel time. |
| pred | Predicate used to decide whether the wait is complete. |
- Returns
- Wait result indicating whether the condition was satisfied before the deadline.
The documentation for this class was generated from the following file: