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

An object oriented wrapper around a recursive mutex. More...

#include <rtt/os/Mutex.hpp>

Inheritance diagram for RTT::os::MutexRecursive:
RTT::os::MutexInterface

Public Member Functions

 MutexRecursive ()
 Initialize a recursive Mutex. More...
 
virtual ~MutexRecursive ()
 Destroy a MutexRecursive. More...
 
void lock ()
 
virtual void unlock ()
 
virtual bool trylock ()
 Try to lock this mutex. More...
 
virtual bool timedlock (Seconds s)
 Lock this mutex, but don't wait longer for the lock than the specified timeout. More...
 
virtual void lock_shared ()
 
virtual void unlock_shared ()
 
virtual bool trylock_shared ()
 
virtual bool timedlock_shared (Seconds)
 

Protected Attributes

rt_rec_mutex_t recm
 

Detailed Description

An object oriented wrapper around a recursive mutex.

A mutex can only be unlock()'ed, by the thread which lock()'ed it. A trylock is a non blocking lock action which fails or succeeds.

See also
MutexLock, MutexTryLock, Mutex

Definition at line 218 of file Mutex.hpp.

Constructor & Destructor Documentation

RTT::os::MutexRecursive::MutexRecursive ( )
inline

Initialize a recursive Mutex.

Definition at line 227 of file Mutex.hpp.

References rtos_mutex_rec_init().

virtual RTT::os::MutexRecursive::~MutexRecursive ( )
inlinevirtual

Destroy a MutexRecursive.

If the MutexRecursive is still locked, the RTOS will not be asked to clean up its resources.

Definition at line 237 of file Mutex.hpp.

References rtos_mutex_rec_destroy().

Member Function Documentation

void RTT::os::MutexRecursive::lock ( )
inlinevirtual

Implements RTT::os::MutexInterface.

Definition at line 245 of file Mutex.hpp.

References rtos_mutex_rec_lock().

Referenced by timedlock().

virtual void RTT::os::MutexInterface::lock_shared ( )
inlinevirtualinherited

Reimplemented in RTT::os::SharedMutex.

Definition at line 75 of file Mutex.hpp.

Referenced by RTT::os::SharedMutexLock::SharedMutexLock().

virtual bool RTT::os::MutexRecursive::timedlock ( Seconds  s)
inlinevirtual

Lock this mutex, but don't wait longer for the lock than the specified timeout.

Parameters
sThe maximum time to wait before aqcuiring the lock.
Returns
true when the locking succeeded, false otherwise

Implements RTT::os::MutexInterface.

Definition at line 274 of file Mutex.hpp.

References lock(), rtos_mutex_rec_trylock_for(), and RTT::Seconds_to_nsecs().

virtual bool RTT::os::MutexInterface::timedlock_shared ( Seconds  )
inlinevirtualinherited

Reimplemented in RTT::os::SharedMutex.

Definition at line 78 of file Mutex.hpp.

virtual bool RTT::os::MutexRecursive::trylock ( )
inlinevirtual

Try to lock this mutex.

Returns
true when the locking succeeded, false otherwise

Implements RTT::os::MutexInterface.

Definition at line 260 of file Mutex.hpp.

References rtos_mutex_rec_trylock().

virtual bool RTT::os::MutexInterface::trylock_shared ( )
inlinevirtualinherited

Reimplemented in RTT::os::SharedMutex.

Definition at line 77 of file Mutex.hpp.

virtual void RTT::os::MutexRecursive::unlock ( )
inlinevirtual

Implements RTT::os::MutexInterface.

Definition at line 250 of file Mutex.hpp.

References rtos_mutex_rec_unlock().

virtual void RTT::os::MutexInterface::unlock_shared ( )
inlinevirtualinherited

Reimplemented in RTT::os::SharedMutex.

Definition at line 76 of file Mutex.hpp.

Member Data Documentation

rt_rec_mutex_t RTT::os::MutexRecursive::recm
protected

Definition at line 222 of file Mutex.hpp.


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