forked from OSchip/llvm-project
Fixing warnings shouldn't introduce a crasher.
Fix the warning the correct way without making things crash when ENABLE_MUTEX_ERROR_CHECKING is non enabled. <rdar://problem/17703039> llvm-svn: 213394
This commit is contained in:
parent
32f59d8e1e
commit
d46bb62610
|
@ -242,9 +242,9 @@ Mutex::Mutex (Mutex::Type type) :
|
|||
//----------------------------------------------------------------------
|
||||
Mutex::~Mutex()
|
||||
{
|
||||
#if ENABLE_MUTEX_ERROR_CHECKING
|
||||
int err = ::pthread_mutex_destroy (&m_mutex);
|
||||
assert(err == 0);
|
||||
#if ENABLE_MUTEX_ERROR_CHECKING
|
||||
if (err == 0)
|
||||
error_check_mutex (&m_mutex, eMutexActionDestroyed);
|
||||
else
|
||||
|
@ -253,6 +253,8 @@ Mutex::~Mutex()
|
|||
assert(err == 0);
|
||||
}
|
||||
memset (&m_mutex, '\xba', sizeof(m_mutex));
|
||||
#else
|
||||
::pthread_mutex_destroy (&m_mutex);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue