Orocos Real-Time Toolkit  2.9.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RTT::os::MutexTryLock Class Reference

A MutexTryLock tries to lock an Mutex object on construction and if successful, unlocks it on destruction of the MutexTryLock. More...

#include <rtt/os/MutexLock.hpp>

Public Member Functions

 MutexTryLock (MutexInterface &mutex)
 Try to lock a Mutex object. More...
 
bool isSuccessful ()
 Return if the locking of the Mutex was succesfull. More...
 
 ~MutexTryLock ()
 Releases, if any, a lock on the previously try-locked Mutex. More...
 

Protected Member Functions

 MutexTryLock ()
 

Protected Attributes

MutexInterface_mutex
 The Mutex to lock and unlock. More...
 

Detailed Description

A MutexTryLock tries to lock an Mutex object on construction and if successful, unlocks it on destruction of the MutexTryLock.

Use isSuccessful() to check whether the attempt succeeded.

Definition at line 87 of file MutexLock.hpp.

Constructor & Destructor Documentation

RTT::os::MutexTryLock::MutexTryLock ( MutexInterface mutex)
inline

Try to lock a Mutex object.

Parameters
mutexThe Mutex which should be attempted to be locked

Definition at line 97 of file MutexLock.hpp.

RTT::os::MutexTryLock::~MutexTryLock ( )
inline

Releases, if any, a lock on the previously try-locked Mutex.

Definition at line 115 of file MutexLock.hpp.

RTT::os::MutexTryLock::MutexTryLock ( )
inlineprotected

Definition at line 127 of file MutexLock.hpp.

Member Function Documentation

bool RTT::os::MutexTryLock::isSuccessful ( )
inline

Return if the locking of the Mutex was succesfull.

Returns
true when the Mutex is locked

Definition at line 107 of file MutexLock.hpp.

Referenced by RTT::extras::SequentialActivity::trigger().

Member Data Documentation

MutexInterface* RTT::os::MutexTryLock::_mutex
protected

The Mutex to lock and unlock.

Definition at line 125 of file MutexLock.hpp.


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