#include <mutex.h>
Collaboration diagram for RecursiveMutex:
Public Member Functions | |
RecursiveMutex () | |
Create a recursive mutex. | |
~RecursiveMutex () | |
void | lock () |
Lock the mutex. | |
bool | test () |
Try to lock the mutex: Non-blocking variant of lock(). | |
void | unlock () |
Unlock the mutex. | |
Private Attributes | |
GStaticRecMutex | m |
Definition at line 129 of file mutex.h.
|
Create a recursive mutex.
Definition at line 34 of file mutex.cc. References m. |
|
Destroy a mutex. Make sure that the mutex is unlocked before destroying it. Definition at line 143 of file mutex.h. References m, and USE_PRIVATE__PTHREADS. |
|
Lock the mutex. If the mutex is currently unlocked, it becomes locked and owned by the calling thread, and the function returns immediately. If the mutex is already locked by another thread, this function suspends the calling thread until the mutex is unlocked. If the mutex is already locked by the calling thread, the call succeeds and returns immediately, recording the number of times the calling thread has locked the mutex. An equal number of unlock() operations must be performed before the mutex returns to the unlocked state. Definition at line 163 of file mutex.h. References m, and USE_PRIVATE__PTHREADS. Referenced by ModulePool::_FindObjectByName(), ModulePool::_load(), ThreadKernel::_NRunningThreads(), ThreadKernel::_PhookNotifier(), MessageManager::_PostMessage(), MessageManager::_RegisterHandler(), MessageManager::_SelectMessageTypes(), ThreadKernel::_ThreadFuncWrapper(), ThreadKernel::_unregister(), ModulePool::_unregister(), MessageManager::_UnregisterHandler(), ThreadKernel::ThreadKernel(), MessageManager::~MessageManager(), ModulePool::~ModulePool(), and ThreadKernel::~ThreadKernel(). |
|
Try to lock the mutex: Non-blocking variant of lock().
Definition at line 175 of file mutex.h. References m, and USE_PRIVATE__PTHREADS. |
|
Unlock the mutex. The mutex is assumed to be locked and owned by the calling thread on entrance to this function. The function decrements the locking count of the mutex (number of lock() operations performed on it), and only when this count reaches zero is the mutex actually unlocked. Definition at line 190 of file mutex.h. References m, and USE_PRIVATE__PTHREADS. Referenced by ModulePool::_FindObjectByName(), ModulePool::_load(), ThreadKernel::_NRunningThreads(), ThreadKernel::_PhookNotifier(), MessageManager::_PostMessage(), MessageManager::_RegisterHandler(), MessageManager::_SelectMessageTypes(), ThreadKernel::_ThreadFuncWrapper(), ThreadKernel::_unregister(), ModulePool::_unregister(), MessageManager::_UnregisterHandler(), ThreadKernel::ThreadKernel(), MessageManager::~MessageManager(), ModulePool::~ModulePool(), and ThreadKernel::~ThreadKernel(). |
|
Definition at line 135 of file mutex.h. Referenced by lock(), RecursiveMutex(), test(), unlock(), and ~RecursiveMutex(). |