Commit dd3d9333 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Use error-checking mutexes on all platforms when DEBUG is on

Otherwise ASSERT_LOCK_HELD will cause deadlocks
parent ee8e3c3f
......@@ -104,10 +104,14 @@ osThreadIsAlive(OSThreadId id STG_UNUSED)
void
initMutex(Mutex* pMut)
{
#if defined(DEBUG) && defined(linux_HOST_OS)
#if defined(DEBUG)
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
#if defined(linux_HOST_OS)
pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_ERRORCHECK_NP);
#else
pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_ERRORCHECK);
#endif
pthread_mutex_init(pMut,&attr);
#else
pthread_mutex_init(pMut,NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment