NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
CMutex Class Reference

Search Toolkit Book for CMutex

CMutex –. More...

#include <corelib/ncbimtx.hpp>

+ Inheritance diagram for CMutex:
+ Collaboration diagram for CMutex:

Public Types

typedef CMutexGuard TReadLockGuard
 Define Read Lock Guard. More...
 
typedef CMutexGuard TWriteLockGuard
 Define Write Lock Guard. More...
 

Public Member Functions

 CMutex (void)
 Constructor. More...
 
 ~CMutex (void)
 Destructor. More...
 
 operator SSystemMutex & (void)
 Get SSystemMutex. More...
 
void Lock (void)
 Lock mutex. More...
 
bool TryLock (void)
 Try locking mutex. More...
 
void Unlock (void)
 Unlock mutex. More...
 

Private Member Functions

 CMutex (const CMutex &)
 Private copy constructor to disallow initialization. More...
 
CMutexoperator= (const CMutex &)
 Private assignment operator to disallow assignment. More...
 

Private Attributes

SSystemMutex m_Mutex
 System mutex. More...
 

Friends

class CRWLock
 Allow use of m_Mtx and m_Owner members directly. More...
 

Detailed Description

CMutex –.

Mutex that allows nesting with runtime checks.

Allows for recursive locks by the same thread. Checks the mutex owner before unlocking. This mutex should be used when performance is less important than data protection. For faster performance see CFastMutex.

See also
http://www.ncbi.nlm.nih.gov/books/n/toolkit/ch_core#ch_core.mutexes

Definition at line 748 of file ncbimtx.hpp.


The documentation for this class was generated from the following file:
Modified on Sat Feb 24 07:50:18 2024 by modify_doxy.py rev. 669887