54#define _WIN32_WINNT 0x400
57#pragma comment(lib, "winmm.lib")
65#if defined(__APPLE__) || defined(__linux__)
71#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
78#define VHACD_VERIFY(x) (x)
80#define VHACD_VERIFY(x) assert((x))
92#if defined(WIN32) || defined(_XBOX)
93 InitializeCriticalSection(&m_mutex);
94#elif defined(__APPLE__) || defined(__linux__)
95 pthread_mutexattr_t mutexAttr;
97 VHACD_VERIFY(pthread_mutexattr_settype(&mutexAttr, PTHREAD_MUTEX_RECURSIVE_NP) == 0);
98 VHACD_VERIFY(pthread_mutex_init(&m_mutex, &mutexAttr) == 0);
99 VHACD_VERIFY(pthread_mutexattr_destroy(&mutexAttr) == 0);
105#if defined(WIN32) || defined(_XBOX)
106 DeleteCriticalSection(&m_mutex);
107#elif defined(__APPLE__) || defined(__linux__)
113#if defined(WIN32) || defined(_XBOX)
114 EnterCriticalSection(&m_mutex);
115#elif defined(__APPLE__) || defined(__linux__)
121#if defined(WIN32) || defined(_XBOX)
124 bRet = TryEnterCriticalSection(&m_mutex) ? true :
false;
126#elif defined(__APPLE__) || defined(__linux__)
127 int32_t result = pthread_mutex_trylock(&m_mutex);
128 return (result == 0);
134#if defined(WIN32) || defined(_XBOX)
135 LeaveCriticalSection(&m_mutex);
136#elif defined(__APPLE__) || defined(__linux__)
142#if defined(WIN32) || defined(_XBOX)
143 CRITICAL_SECTION m_mutex;
144#elif defined(__APPLE__) || defined(__linux__)
145 pthread_mutex_t m_mutex;
Definition: vhacdMutex.h:88
void Unlock(void)
Definition: vhacdMutex.h:132
void Lock(void)
Definition: vhacdMutex.h:111
bool TryLock(void)
Definition: vhacdMutex.h:119
~Mutex(void)
Definition: vhacdMutex.h:103
Mutex(void)
Definition: vhacdMutex.h:90
Definition: bullet_cast_bvh_manager.h:49
#define VHACD_VERIFY(x)
Definition: vhacdMutex.h:80