RTT::os::MutexTimedLock Class Reference

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. More...

#include <MutexLock.hpp>

List of all members.

Public Member Functions

bool isSuccessful ()
bool isSuccessful ()
 MutexTimedLock (MutexInterface &mutex, Seconds timeout)
 MutexTimedLock (MutexInterface &mutex, Seconds timeout)
 ~MutexTimedLock ()
 ~MutexTimedLock ()

Protected Member Functions

 MutexTimedLock ()
 MutexTimedLock ()

Protected Attributes

MutexInterface_mutex

Private Attributes

bool successful

Detailed Description

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 install/include/rtt/os/MutexLock.hpp.


Constructor & Destructor Documentation

RTT::os::MutexTimedLock::MutexTimedLock ( MutexInterface mutex,
Seconds  timeout 
) [inline]

Lock a Mutex object, but don't block longer than a specified timeout.

Parameters:
mutex The Mutex which should be attempted to be locked
timeout The maximum time to wait in seconds.

Definition at line 158 of file install/include/rtt/os/MutexLock.hpp.

RTT::os::MutexTimedLock::~MutexTimedLock (  )  [inline]

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

Definition at line 176 of file install/include/rtt/os/MutexLock.hpp.

RTT::os::MutexTimedLock::MutexTimedLock (  )  [inline, protected]

Definition at line 188 of file install/include/rtt/os/MutexLock.hpp.

RTT::os::MutexTimedLock::MutexTimedLock ( MutexInterface mutex,
Seconds  timeout 
) [inline]

Lock a Mutex object, but don't block longer than a specified timeout.

Parameters:
mutex The Mutex which should be attempted to be locked
timeout The maximum time to wait in seconds.

Definition at line 158 of file rtt/os/MutexLock.hpp.

RTT::os::MutexTimedLock::~MutexTimedLock (  )  [inline]

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

Definition at line 176 of file rtt/os/MutexLock.hpp.

RTT::os::MutexTimedLock::MutexTimedLock (  )  [inline, protected]

Definition at line 188 of file rtt/os/MutexLock.hpp.


Member Function Documentation

bool RTT::os::MutexTimedLock::isSuccessful (  )  [inline]

Return if the locking of the Mutex was succesfull

Returns:
true when the Mutex is locked

Definition at line 168 of file rtt/os/MutexLock.hpp.

bool RTT::os::MutexTimedLock::isSuccessful (  )  [inline]

Return if the locking of the Mutex was succesfull

Returns:
true when the Mutex is locked

Definition at line 168 of file install/include/rtt/os/MutexLock.hpp.


Member Data Documentation

The Mutex to lock and unlock

Definition at line 186 of file install/include/rtt/os/MutexLock.hpp.

Stores the state of success

Definition at line 196 of file install/include/rtt/os/MutexLock.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:50:10 2013