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

#include <CXPlatCriticalSection.h>

List of all members.

Public Member Functions

 CXPlatCriticalSection ()
 Constructor.
 ~CXPlatCriticalSection ()
 Destructor.
int Lock (DWORD dwWait=INFINITE)
 Tries to obtain exclusive access.
int Unlock ()
 Releases exclusive access.

Protected Attributes

pthread_mutex_t m_csHandle
pthread_t lock_id
int lock_count

Friends

class CXPlatEvent

Detailed Description

Cross plaform synchronization class

On Windows, critical sections are "cheaper" than interprocess mutexes (mutii?)

Definition at line 26 of file CXPlatCriticalSection.h.


Constructor & Destructor Documentation

Constructor.

Definition at line 26 of file CXPlatCriticalSection.cpp.

Destructor.

Definition at line 38 of file CXPlatCriticalSection.cpp.


Member Function Documentation

Tries to obtain exclusive access.

Definition at line 49 of file CXPlatCriticalSection.cpp.

Releases exclusive access.

Definition at line 88 of file CXPlatCriticalSection.cpp.


Friends And Related Function Documentation

friend class CXPlatEvent [friend]

Definition at line 28 of file CXPlatCriticalSection.h.


Member Data Documentation

Definition at line 46 of file CXPlatCriticalSection.h.

pthread_t CXPlatCriticalSection::lock_id [protected]

Definition at line 45 of file CXPlatCriticalSection.h.

pthread_mutex_t CXPlatCriticalSection::m_csHandle [protected]

Definition at line 44 of file CXPlatCriticalSection.h.


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