From: Jason Dillaman Date: Fri, 15 May 2015 14:49:36 +0000 (-0400) Subject: common: Mutex shouldn't register w/ lockdep if disabled X-Git-Tag: v0.94.4~76^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c95b37f48c129ef6780f67b326e97957f3771472;p=ceph.git common: Mutex shouldn't register w/ lockdep if disabled Signed-off-by: Jason Dillaman (cherry picked from commit 879b8a73e2452332b26b8f3428ff5e3e0af8ddad) --- diff --git a/src/common/Mutex.cc b/src/common/Mutex.cc index 011b6af09d65..82e7ce72e1de 100644 --- a/src/common/Mutex.cc +++ b/src/common/Mutex.cc @@ -43,7 +43,7 @@ Mutex::Mutex(const std::string &n, bool r, bool ld, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init(&_m,&attr); pthread_mutexattr_destroy(&attr); - if (g_lockdep) + if (lockdep && g_lockdep) _register(); } else if (lockdep) { @@ -75,7 +75,7 @@ Mutex::~Mutex() { cct->get_perfcounters_collection()->remove(logger); delete logger; } - if (g_lockdep) { + if (lockdep && g_lockdep) { lockdep_unregister(id); } }