RTT::OS::Mutex Class Reference

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

#include <rtt/os/Mutex.hpp>

Inheritance diagram for RTT::OS::Mutex:

RTT::OS::MutexInterface

List of all members.

Public Member Functions

 Mutex ()
 Initialize a Mutex.
virtual ~Mutex ()
 Destroy a Mutex.
virtual void lock ()
virtual void unlock ()
virtual bool trylock ()
 Try to lock this mutex.

Protected Attributes

rt_mutex_t m

Friends

class OS::MutexLock
class OS::MutexTryLock


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, MutexRecursive

Definition at line 74 of file Mutex.hpp.


Constructor & Destructor Documentation

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

Destroy a Mutex.

This is a blocking operation on the mutex itself. The mutex may not be locked when you call the destructor.

Definition at line 95 of file Mutex.hpp.


Member Function Documentation

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


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

Generated on Tue Aug 25 14:17:26 2009 for Orocos Real-Time Toolkit by  doxygen 1.5.8