]> 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>
Wed, 29 Jul 2015 17:29:54 +0000 (13:29 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 879b8a73e2452332b26b8f3428ff5e3e0af8ddad)

src/common/Mutex.cc

index 011b6af09d65d38f796f4ed3ee36a0126139523d..82e7ce72e1deac434a809d825edc274716b36194 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) {
@@ -75,7 +75,7 @@ Mutex::~Mutex() {
     cct->get_perfcounters_collection()->remove(logger);
     delete logger;
   }
-  if (g_lockdep) {
+  if (lockdep && g_lockdep) {
     lockdep_unregister(id);
   }
 }