]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Mutex shouldn't register w/ lockdep if disabled
authorJason Dillaman <dillaman@redhat.com>
Fri, 15 May 2015 14:49:36 +0000 (10:49 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 5 Jun 2015 16:29:32 +0000 (12:29 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/common/Mutex.cc

index 064c3b30efcf2c29740d0d2ebf12799496178675..cedba098128cb55238fb7a53e76ba9af5bbdf7ee 100644 (file)
@@ -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) {
@@ -76,7 +76,7 @@ Mutex::~Mutex() {
     cct->get_perfcounters_collection()->remove(logger);
     delete logger;
   }
-  if (g_lockdep) {
+  if (lockdep && g_lockdep) {
     lockdep_unregister(id);
   }
 }