DCL 4.0
Loading...
Searching...
No Matches
InternalMutex Class Reference

#include <LibState.h>

Public Member Functions

 InternalMutex (const char *pszName)
 ~InternalMutex ()
void lock ()
void unlock ()

Detailed Description

Definition at line 16 of file LibState.h.

Constructor & Destructor Documentation

◆ InternalMutex()

__DCL_BEGIN_NAMESPACE InternalMutex::InternalMutex ( const char * pszName)

Definition at line 34 of file LibState.cpp.

35{
36#if __DCL_PTHREAD
37 pthread_mutex_init(&m_mutex, NULL);
38#elif __DCL_WINDOWS
39 InitializeCriticalSection(&m_cs);
40#endif
41 m_pszName = pszName;
42}
#define NULL
Definition Config.h:340

◆ ~InternalMutex()

InternalMutex::~InternalMutex ( )

Definition at line 44 of file LibState.cpp.

45{
46#if __DCL_PTHREAD
47 pthread_mutex_destroy(&m_mutex);
48#elif __DCL_WINDOWS
49 DeleteCriticalSection(&m_cs);
50#endif
51}

Member Function Documentation

◆ lock()

void InternalMutex::lock ( )

Definition at line 53 of file LibState.cpp.

54{
55#if __DCL_PTHREAD
56 pthread_mutex_lock(&m_mutex);
57#elif __DCL_WINDOWS
58 EnterCriticalSection(&m_cs);
59#endif
60}

◆ unlock()

void InternalMutex::unlock ( )

Definition at line 62 of file LibState.cpp.

63{
64#if __DCL_PTHREAD
65 pthread_mutex_unlock(&m_mutex);
66#elif __DCL_WINDOWS
67 LeaveCriticalSection(&m_cs);
68#endif
69}

The documentation for this class was generated from the following files: