All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HSEP::Mutex Class Reference

Provides a basic inter-process synchronization mutex. More...

#include <POSIX_Mutex.h>

+ Inheritance diagram for HSEP::Mutex:

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.
 

Detailed Description

Provides a basic inter-process synchronization mutex.

Definition at line 32 of file POSIX_Mutex.h.

Constructor & Destructor Documentation

HSEP::Mutex::Mutex ( bool  pShared = false)

Creates a concurrent synchronization Mutex.

Parameters
pSharedwhen 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.

Member Function Documentation

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.

See Also
Dam

Definition at line 47 of file POSIX_Mutex.cpp.


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