#include <Thread.h>
Public Member Functions | |
Mutex () | |
Class constructor. | |
virtual | ~Mutex () |
Class destructor. | |
bool | lock () |
Lock mutex. | |
void | unlock () |
Unlock mutex. |
Mutex class.
Implements pthread mutex functionality.
Mutex::Mutex | ( | ) |
Class constructor.
Initializes the mutex object. Initial state of the mutex is unlocked.
Mutex::~Mutex | ( | ) | [virtual] |
Class destructor.
Terminates the mutex object. The mutex is unlocked before termination.
bool Mutex::lock | ( | ) |
Lock mutex.
Locks (or acquires) the mutex object by the calling thread. The call will block until the mutex is unlocked by another thread.
void Mutex::unlock | ( | ) |
Unlock mutex.
Unlocks (or releases) the mutex object and releases all lock() calls. The first thread that is pending on mutex lock will be released.