Orocos Real-Time Toolkit
2.9.0
|
An object oriented wrapper around a condition variable. More...
#include <rtt/os/Condition.hpp>
Public Member Functions | |
Condition () | |
Initialize a Condition. More... | |
~Condition () | |
Destroy a Condition. More... | |
bool | wait (Mutex &m) |
Wait forever until a condition occurs. More... | |
template<class Predicate > | |
bool | wait (Mutex &m, Predicate &p) |
Wait forever until a condition occurs. More... | |
void | broadcast () |
Wake all threads that are blocking in wait() or wait_until(). More... | |
bool | wait_until (Mutex &m, nsecs abs_time) |
Wait for this condition, but don't wait longer for it than the specified absolute time. More... | |
Protected Attributes | |
rt_cond_t | c |
An object oriented wrapper around a condition variable.
Definition at line 60 of file Condition.hpp.
|
inline |
|
inline |
Destroy a Condition.
If the Condition is still locked, the RTOS will not be asked to clean up its resources.
Definition at line 79 of file Condition.hpp.
References rtos_cond_destroy().
|
inline |
Wake all threads that are blocking in wait() or wait_until().
Definition at line 113 of file Condition.hpp.
References rtos_cond_broadcast().
Referenced by RTT::os::Timer::arm(), RTT::ExecutionEngine::process(), RTT::ExecutionEngine::processFunctions(), RTT::ExecutionEngine::processMessages(), RTT::os::Timer::startTimer(), RTT::Activity::stop(), RTT::Activity::timeout(), and RTT::Activity::trigger().
|
inline |
Wait forever until a condition occurs.
m | The mutex you hold locked when calling this function. |
Definition at line 90 of file Condition.hpp.
References RTT::os::Mutex::m, and rtos_cond_wait().
Referenced by wait_until(), RTT::ExecutionEngine::waitAndProcessMessages(), and RTT::ExecutionEngine::waitForMessagesInternal().
|
inline |
Wait forever until a condition occurs.
m | The mutex you hold locked when calling this function. |
p | A function object returning a boolean |
Definition at line 104 of file Condition.hpp.
References RTT::os::Mutex::m, and rtos_cond_wait().
Wait for this condition, but don't wait longer for it than the specified absolute time.
m | The mutex you hold locked when calling this function. |
abs_time | The absolute time to wait until before the condition happens. Use rtos_get_time_ns() to get the current time and Seconds_to_nsecs to add a certain amount to the result. |
Definition at line 129 of file Condition.hpp.
References RTT::os::Mutex::m, rtos_cond_timedwait(), and wait().
Referenced by RTT::Activity::loop().
|
protected |
Definition at line 64 of file Condition.hpp.