Public Member Functions | Protected Attributes | Friends
RTT::os::Mutex Class Reference

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

#include <Mutex.hpp>

Inheritance diagram for RTT::os::Mutex:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void lock ()
 Mutex ()
virtual bool timedlock (Seconds s)
virtual bool trylock ()
virtual void unlock ()
virtual ~Mutex ()

Protected Attributes

rt_mutex_t m

Friends

class Condition

Detailed Description

An object oriented wrapper around a non 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.

Warning:
Mutex instances should only be created in soft realtime, since the initialisation of a mutex can not be done in hard realtime.
See also:
MutexLock, MutexTryLock, MutexTimedLock, MutexRecursive

Definition at line 82 of file Mutex.hpp.


Constructor & Destructor Documentation

RTT::os::Mutex::Mutex ( ) [inline]

Initialize a Mutex.

Definition at line 92 of file Mutex.hpp.

virtual RTT::os::Mutex::~Mutex ( ) [inline, virtual]

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

Definition at line 102 of file Mutex.hpp.


Member Function Documentation

virtual void RTT::os::Mutex::lock ( ) [inline, virtual]

Implements RTT::os::MutexInterface.

Definition at line 110 of file Mutex.hpp.

virtual bool RTT::os::Mutex::timedlock ( Seconds  s) [inline, virtual]

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 139 of file Mutex.hpp.

virtual bool RTT::os::Mutex::trylock ( ) [inline, virtual]

Try to lock this mutex

Returns:
true when the locking succeeded, false otherwise

Implements RTT::os::MutexInterface.

Definition at line 125 of file Mutex.hpp.

virtual void RTT::os::Mutex::unlock ( ) [inline, virtual]

Implements RTT::os::MutexInterface.

Definition at line 115 of file Mutex.hpp.


Friends And Related Function Documentation

friend class Condition [friend]

Definition at line 84 of file Mutex.hpp.


Member Data Documentation

Definition at line 87 of file Mutex.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:59