Orocos Real-Time Toolkit
2.9.0
|
A MutexTimedLock locks a Mutex object on construction and if successful, unlocks it on destruction of the MutexTimedLock. More...
#include <rtt/os/MutexLock.hpp>
Public Member Functions | |
MutexTimedLock (MutexInterface &mutex, Seconds timeout) | |
Lock a Mutex object, but don't block longer than a specified timeout. More... | |
bool | isSuccessful () |
Return if the locking of the Mutex was succesfull. More... | |
~MutexTimedLock () | |
Releases, if any, a lock on the previously try-locked Mutex. More... | |
Protected Member Functions | |
MutexTimedLock () | |
Protected Attributes | |
MutexInterface * | _mutex |
The Mutex to lock and unlock. More... | |
A MutexTimedLock locks a Mutex object on construction and if successful, unlocks it on destruction of the MutexTimedLock.
If the lock can not be acquired within the user provided time limit, the attempt is aborted. Use isSuccessful() to check whether the attempt succeeded.
Definition at line 146 of file MutexLock.hpp.
|
inline |
Lock a Mutex object, but don't block longer than a specified timeout.
mutex | The Mutex which should be attempted to be locked |
timeout | The maximum time to wait in seconds. |
Definition at line 158 of file MutexLock.hpp.
|
inline |
Releases, if any, a lock on the previously try-locked Mutex.
Definition at line 176 of file MutexLock.hpp.
|
inlineprotected |
Definition at line 188 of file MutexLock.hpp.
|
inline |
Return if the locking of the Mutex was succesfull.
Definition at line 168 of file MutexLock.hpp.
Referenced by RTT::os::Thread::stop(), and RTT::Activity::stop().
|
protected |
The Mutex to lock and unlock.
Definition at line 186 of file MutexLock.hpp.