#include <pthread.h>
#include <semaphore.h>
#include <stlib/Object.h>
Include dependency graph for Semaphore.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Namespaces | |
namespace | OS |
Defines | |
#define | _REENTRANT |
#define | _critical(mutex, guardedBlock) |
This macro should simplify critical sections handling. |
|
Value: _ensure( \ mutex->wait(); \ guardedBlock \ , \ mutex->signal() \ )
It uses mutex given as first argument to guard commands given in second. Mutex will unlock on the end of the section even if guarded commands fail with an exception. Semaphore *mutex = Semaphore::forMutualExclusion(); _critical ( // Mutex to use mutex , // Commands to evaluate inside mutex guarded section ); Definition at line 69 of file Semaphore.h. |
|
Definition at line 28 of file Semaphore.h. |