C++ common classes
General purpose classes for use across projects (Apache license)
CXPlatMutex Class Reference

Cross platform mutex object. More...

#include <CXPlatMutex.h>

List of all members.

Public Member Functions

 CXPlatMutex ()
 Constructor.
 CXPlatMutex (const char *szName)
 Constructor.
 ~CXPlatMutex ()
 Destructor.
int Lock (DWORD dwWait=INFINITE)
 Tries to obtain exclusive access.
void Unlock ()
 Releases exclusive access.
pthread_mutex_t * GetMutexHandle ()

Protected Attributes

pthread_mutex_t mutex_data
pthread_mutex_t * m_csHandle
int shared_mem_id
pthread_mutexattr_t mutex_shared_attr
pthread_t lock_id
pthread_t * p_lock_id
int lock_count
int * p_lock_count

Static Protected Attributes

static const char * szMutexSig = "_XPLAT_MUTEX"

Detailed Description

Cross platform mutex object.

Definition at line 22 of file CXPlatMutex.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 32 of file CXPlatMutex.cpp.

CXPlatMutex::CXPlatMutex ( const char *  szName)

Constructor.

intra-process mutex

Definition at line 46 of file CXPlatMutex.cpp.

Destructor.

inter-process named mutex

Definition at line 88 of file CXPlatMutex.cpp.


Member Function Documentation

pthread_mutex_t * CXPlatMutex::GetMutexHandle ( )

Definition at line 148 of file CXPlatMutex.cpp.

int CXPlatMutex::Lock ( DWORD  dwWait = INFINITE)

Tries to obtain exclusive access.

Definition at line 100 of file CXPlatMutex.cpp.

Releases exclusive access.

Definition at line 132 of file CXPlatMutex.cpp.


Member Data Documentation

int CXPlatMutex::lock_count [protected]

Definition at line 54 of file CXPlatMutex.h.

pthread_t CXPlatMutex::lock_id [protected]

Definition at line 52 of file CXPlatMutex.h.

pthread_mutex_t* CXPlatMutex::m_csHandle [protected]

Definition at line 49 of file CXPlatMutex.h.

pthread_mutex_t CXPlatMutex::mutex_data [protected]

Definition at line 48 of file CXPlatMutex.h.

pthread_mutexattr_t CXPlatMutex::mutex_shared_attr [protected]

Definition at line 51 of file CXPlatMutex.h.

int* CXPlatMutex::p_lock_count [protected]

Definition at line 55 of file CXPlatMutex.h.

pthread_t* CXPlatMutex::p_lock_id [protected]

Definition at line 53 of file CXPlatMutex.h.

int CXPlatMutex::shared_mem_id [protected]

Definition at line 50 of file CXPlatMutex.h.

const char * CXPlatMutex::szMutexSig = "_XPLAT_MUTEX" [static, protected]

Definition at line 44 of file CXPlatMutex.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines