From d46bb62610dd9a15d06c739d1aebbd776ba7e9b1 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 18 Jul 2014 18:32:45 +0000 Subject: [PATCH] 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. llvm-svn: 213394 --- lldb/source/Host/common/Mutex.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/source/Host/common/Mutex.cpp b/lldb/source/Host/common/Mutex.cpp index 4e01355..c26467f 100644 --- a/lldb/source/Host/common/Mutex.cpp +++ b/lldb/source/Host/common/Mutex.cpp @@ -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 } -- 2.7.4