#include <CThreadRecursiveMutex.h>
Inheritance diagram for CThreadRecursiveMutex:
Public Member Functions | |
CThreadRecursiveMutex () | |
Default Constructor. | |
~CThreadRecursiveMutex () | |
Destructor. | |
DAQThreadMutex | getMutex () const |
< Retrieve m_Mutex | |
daqthread_t | getOwningThread () const |
< Retrieve m_tOwningThread | |
unsigned | getLockLevel () const |
< Retrieve m_LockLevel | |
DAQThreadMutex | getMonitorMutex () const |
< Return m_MonitoMutex | |
int | Lock () |
int | UnLock () |
int | TryLock () |
int | isLocked () |
void | UnLockCompletely () |
Protected Member Functions | |
void | setMutex (const DAQThreadMutex am_Mutex) |
void | setOwningThread (const daqthread_t am_tOwningThread) |
void | setLockLevel (const unsigned am_nLockLevel) |
void | setMonitorMutex (const DAQThreadMutex am_MonitorMutex) |
Private Member Functions | |
CThreadRecursiveMutex (const CThreadRecursiveMutex &rRhs) | |
int | operator== (const CThreadRecursiveMutex &aCThreadRecursiveMutex) const |
Private Attributes | |
DAQThreadMutex | m_Mutex |
Mutex locked. | |
daqthread_t | m_tOwningThread |
Id of owning thread. | |
unsigned | m_nLockLevel |
Locking depth for owning thread. | |
DAQThreadMutex | m_MonitorMutex |
Atomicity Mutex. |
Definition at line 320 of file CThreadRecursiveMutex.h.
|
Default Constructor.
Definition at line 314 of file CThreadRecursiveMutex.cpp. |
|
Destructor.
Definition at line 325 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex, m_Mutex, and m_nLockLevel. |
|
Copy construction is illegal and hence private and not implemented. |
|
< Retrieve m_LockLevel
Definition at line 359 of file CThreadRecursiveMutex.h. Referenced by CEvent::Disable(). |
|
< Return m_MonitoMutex
Definition at line 363 of file CThreadRecursiveMutex.h. |
|
< Retrieve m_Mutex
Definition at line 351 of file CThreadRecursiveMutex.h. |
|
< Retrieve m_tOwningThread
Definition at line 355 of file CThreadRecursiveMutex.h. Referenced by CEvent::Disable(). |
|
Operation Type: Override. Purpose: Returns non zero if someone, anyone (even self()) owns the mutex. Note that the mutex is considered owned if the lock level is nonzero. This should even be faster than the base class implementation. Definition at line 498 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex. |
|
Operation Type: Override. Purpose: Locks the mutex. Returns zero on success, otherwise, errno has the reason for the failure. Note that if we own the mutex the lock level is incremented, otherwise, this function may block. Definition at line 351 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex, m_Mutex, m_nLockLevel, and m_tOwningThread. Referenced by CSocket::Connect(), CDAQTCLProcessor::DeleteRelay(), CEvent::Disable(), CEvent::Enable(), CDAQTCLProcessor::EvalRelay(), CTCPConnectionLost::Host(), CEvent::OnEvent(), CSocket::OpenSocket(), CXtEventLoop::operator()(), CTCPConnectionLost::Port(), CBufferEvent< T >::ProcessAddQueue(), CBufferEvent< T >::ProcessDelQueue(), CServerConnectionEvent::Protocol(), and CBufferEvent< U >::STD(). |
|
Assignment is illegal and hence private and not implemented. |
|
Definition at line 378 of file CThreadRecursiveMutex.h. |
|
Definition at line 381 of file CThreadRecursiveMutex.h. |
|
Definition at line 372 of file CThreadRecursiveMutex.h. |
|
Definition at line 375 of file CThreadRecursiveMutex.h. |
|
Operation Type: Override Purpose: Tries to lock the mutex. If the mutex is owned by the running thread the lock succeeds and the lock level is incremented. If the lock level is zero, then trylock is done on the base class and the result is returned. On success, the lock level is incremented. Returns 0 on success, otherwise, errno has reason for failure, if the lock was already held, errno == EAGAIN. Definition at line 460 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex, m_Mutex, m_nLockLevel, and m_tOwningThread. |
|
Operation Type: Override Purpose: Unlocks a locked mutex. If the mutex is already locked by us, the lock level is decremented. The mutex is not actually released until the lock level goes to zero. If we don't own the mutex, and error results. Returns zero on success, otherwise, errno has the reason for the failure.
Definition at line 406 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex, m_Mutex, m_nLockLevel, and m_tOwningThread. Referenced by CSocket::Connect(), CDAQTCLProcessor::DeleteRelay(), CEvent::Enable(), CDAQTCLProcessor::EvalRelay(), CTCPConnectionLost::Host(), CEvent::OnEvent(), CSocket::OpenSocket(), CXtEventLoop::operator()(), CTCPConnectionLost::Port(), CBufferEvent< T >::ProcessAddQueue(), CBufferEvent< T >::ProcessDelQueue(), CServerConnectionEvent::Protocol(), and CBufferEvent< U >::STD(). |
|
Operation Type: Purpose: Releases all lock levels. If we don't already own the mutex, this call is a no-op, otherwise, the m_nLockLevel variable is set to zero and the underlying semaphore is unlocked. Definition at line 521 of file CThreadRecursiveMutex.cpp. References m_MonitorMutex, m_Mutex, m_nLockLevel, and m_tOwningThread. Referenced by CEvent::Disable(), and CFileEvent::Exit(). |
|
Atomicity Mutex.
Definition at line 328 of file CThreadRecursiveMutex.h. Referenced by isLocked(), Lock(), TryLock(), UnLock(), UnLockCompletely(), and ~CThreadRecursiveMutex(). |
|
Mutex locked.
Definition at line 325 of file CThreadRecursiveMutex.h. Referenced by Lock(), TryLock(), UnLock(), UnLockCompletely(), and ~CThreadRecursiveMutex(). |
|
Locking depth for owning thread.
Definition at line 327 of file CThreadRecursiveMutex.h. Referenced by Lock(), TryLock(), UnLock(), UnLockCompletely(), and ~CThreadRecursiveMutex(). |
|
Id of owning thread.
Definition at line 326 of file CThreadRecursiveMutex.h. Referenced by Lock(), TryLock(), UnLock(), and UnLockCompletely(). |