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

#include <LibState.h>

Public Member Functions

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

Detailed Description

Definition at line 12 of file LibState.h.

Constructor & Destructor Documentation

◆ InternalMutex()

__DCL_BEGIN_NAMESPACE InternalMutex::InternalMutex ( const char * _name)

Definition at line 36 of file LibState.cpp.

37{
38#if __DCL_PTHREAD
39 pthread_mutex_init(&__mutex, NULL);
40#elif defined(__WINNT__)
41 InitializeCriticalSection(&__cs);
42#endif
43 __name = _name;
44}
#define NULL
Definition Config.h:312

◆ ~InternalMutex()

InternalMutex::~InternalMutex ( )

Definition at line 46 of file LibState.cpp.

47{
48#if __DCL_PTHREAD
49 pthread_mutex_destroy(&__mutex);
50#elif defined(__WINNT__)
51 DeleteCriticalSection(&__cs);
52#endif
53}

Member Function Documentation

◆ lock()

void InternalMutex::lock ( )

Definition at line 55 of file LibState.cpp.

56{
57#if __DCL_PTHREAD
58 pthread_mutex_lock(&__mutex);
59#elif defined(__WINNT__)
60 EnterCriticalSection(&__cs);
61#endif
62}

◆ unlock()

void InternalMutex::unlock ( )

Definition at line 64 of file LibState.cpp.

65{
66#if __DCL_PTHREAD
67 pthread_mutex_unlock(&__mutex);
68#elif defined(__WINNT__)
69 LeaveCriticalSection(&__cs);
70#endif
71}

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