mirror of
https://bitbucket.org/seefoe/dockerized-swg-src.git
synced 2026-07-28 23:16:01 -04:00
41 lines
569 B
C++
41 lines
569 B
C++
////////////////////////////////////////
|
|
// Mutex.cpp
|
|
//
|
|
// Purpose:
|
|
// 1. Implementation of the CMutex class.
|
|
//
|
|
// Revisions:
|
|
// 07/10/2001 Created
|
|
//
|
|
|
|
#if defined(_REENTRANT)
|
|
|
|
|
|
#include "Mutex.h"
|
|
|
|
#ifdef EXTERNAL_DISTRO
|
|
namespace NAMESPACE
|
|
{
|
|
|
|
#endif
|
|
namespace Base
|
|
{
|
|
|
|
CMutex::CMutex()
|
|
{
|
|
mInitialized = (pthread_mutex_init(&mMutex, 0) == 0);
|
|
}
|
|
|
|
CMutex::~CMutex()
|
|
{
|
|
if (mInitialized)
|
|
pthread_mutex_destroy(&mMutex);
|
|
}
|
|
|
|
}
|
|
#ifdef EXTERNAL_DISTRO
|
|
};
|
|
#endif
|
|
|
|
#endif // #if defined(_REENTRANT)
|