#include <wefts_mutex.h>
Inheritance diagram for Wefts::Mutex:
This is the fastest and smallest possible mutex. To be used when implementing the condition/mutex raw scheme or when a very small section of not interruptable code is to be protected.
All mutex classes are implemented via inline calls to maximize execution speed; also, their methods are extremely small.
Public Member Functions | |
Mutex () | |
Initializes the internal data of the mutex. | |
~Mutex () | |
Destroys the mutex. | |
virtual void | lock () |
Locks the mutex. | |
virtual bool | trylock () |
Try to lock the mutex. | |
virtual void | unlock () |
Unlocks the mutex. | |
Protected Attributes | |
OSMutex | m_mutex |
|
Initializes the internal data of the mutex.
|
|
Destroys the mutex. Only call this when the mutex is fully unlocked: destroying a locked mutex has undefined result. |
|
Locks the mutex. If the calling thread is already owning the lock, the function will block producing an unavoidable and not interruptable deadlock. Reimplemented in Wefts::RMutex. |
|
Try to lock the mutex. If any thread is currently holding the mutex, the function returns immediately false, while if it is not locked, the mutex is locked and the function returns true. Reimplemented in Wefts::RMutex. |
|
Unlocks the mutex. This method does not checks if the calling thread is the rightful owner of the mutex; unlocking a mutex from a thread that has not locked it has an undefined outcome. Reimplemented in Wefts::RMutex. |
|
|