[Lldb-commits] [lldb] r213394 - Fixing warnings shouldn't introduce a crasher.
Greg Clayton
gclayton at apple.com
Fri Jul 18 11:32:45 PDT 2014
Author: gclayton
Date: Fri Jul 18 13:32:45 2014
New Revision: 213394
URL: http://llvm.org/viewvc/llvm-project?rev=213394&view=rev
Log:
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>
Modified:
lldb/trunk/source/Host/common/Mutex.cpp
Modified: lldb/trunk/source/Host/common/Mutex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Mutex.cpp?rev=213394&r1=213393&r2=213394&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Mutex.cpp (original)
+++ lldb/trunk/source/Host/common/Mutex.cpp Fri Jul 18 13:32:45 2014
@@ -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
}
More information about the lldb-commits
mailing list