Protects a section of code to be executed by only a single thread at any given time.
The Mutex class provides a synchonization object that can be used to protect sections of code to be executed by only a single thread at any given time. This code fragment is also called a critical section, a mutex is also called a semaphore.
Mutex's have a lock() and unlock() method; only one thread can continue from the lock() until the unlock() method is called. During this time, any other thread has to wait until the mutex becomes available.
- Note:
- This implementation does not provide recursive mutexes.
-
Currently, this implementation supports only POSIX threads.
Definition at line 35 of file Mutex.h.