The mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads. More...
#include <Mutex.h>
Public Member Functions | |
virtual | ~IMutex () |
Destructor. | |
virtual void | lock ()=0 |
Locks the mutex. More... | |
virtual void | unlock ()=0 |
Unlocks the mutex. | |
virtual void * | handle ()=0 |
Returns the platform dependent handle associated to this object. | |
Static Public Member Functions | |
static IMutex * | create () |
Creates one new mutex. More... | |
The mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads.
|
static |
Creates one new mutex.
A mutual exclusion object (mutex) is an object that can be owned by one single thread at the same time. Threads can use mutexes to performs operation on block of shared variables atomically.
|
pure virtual |
Locks the mutex.
The calling thread try to get the exclusive ownership over the mutex or wait until it manage to