Mutex Class Reference

#include <rtt/os/Mutex.hpp>

Inheritance diagram for Mutex:

MutexInterface

List of all members.


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.


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

Constructor & Destructor Documentation

virtual ~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.

References Mutex::lock(), Mutex::m, and Mutex::unlock().


Member Function Documentation

virtual bool trylock (  )  [inline, virtual]

Try to lock this mutex.

Returns:
true when the locking succeeded, false otherwise

Implements MutexInterface.

Definition at line 118 of file Mutex.hpp.

References Mutex::m.


The documentation for this class was generated from the following file:
Generated on Tue Mar 25 17:42:02 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3