![]() |
Provides a basic inter-process synchronization mutex. More...
#include <POSIX_Mutex.h>
Public Member Functions | |
Mutex (bool pShared=false) | |
Creates a concurrent synchronization Mutex. | |
~Mutex () | |
void | acquire () |
Acquires the mutex to enter a critical region. | |
void | release () |
Releases the mutex to permit others to enter a critical region. | |
Provides a basic inter-process synchronization mutex.
Definition at line 32 of file POSIX_Mutex.h.
HSEP::Mutex::Mutex | ( | bool | pShared = false | ) |
Creates a concurrent synchronization Mutex.
pShared | when true, defines a Mutex that can be used inside a Shared Memory area. |
Definition at line 26 of file POSIX_Mutex.cpp.
HSEP::Mutex::~Mutex | ( | ) |
Definition at line 39 of file POSIX_Mutex.cpp.
void HSEP::Mutex::acquire | ( | ) |
Acquires the mutex to enter a critical region.
Any other thread and/or process (in the case of Shared mutexes), will be frozen by the operating system until the Mutex is released.
If more than one thread and/or process are frozen, they will be enqueued by the operating system and only one of them will be defrozen when a release method be performed on the Mutex instance.
Definition at line 43 of file POSIX_Mutex.cpp.
void HSEP::Mutex::release | ( | ) |
Releases the mutex to permit others to enter a critical region.
The release call only will defrost one thread. When needing to let more than one Thread to pass, consider the usage of a Dam synchronization primitive.
Definition at line 47 of file POSIX_Mutex.cpp.