tstellar / rpms / ceph

Forked from rpms/ceph 3 years ago
Clone
Blob Blame History Raw
From 149481ac6dc52a852fb53800384a99e3d69ad11a Mon Sep 17 00:00:00 2001
From: Boris Ranto <branto@redhat.com>
Date: Mon, 8 Dec 2014 08:36:37 +0100
Subject: [PATCH 3/3] Backport pull request #2937 to firefly

---
 src/common/RWLock.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/common/RWLock.h b/src/common/RWLock.h
index f901ac0..f4d1937 100644
--- a/src/common/RWLock.h
+++ b/src/common/RWLock.h
@@ -36,7 +36,9 @@ public:
   }
 
   virtual ~RWLock() {
-    pthread_rwlock_unlock(&L);
+    // The following check is racy but we are about to destroy
+    // the object and we assume that there are no other users.
+    //assert(!is_locked()); -- hacky backport, no is_locked in firefly
     pthread_rwlock_destroy(&L);
   }
 
-- 
1.9.3