Mutex Class Reference
#include <rtt/os/Mutex.hpp>
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.
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.
The documentation for this class was generated from the following file: