]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/RWLock: add get()
authorYehuda Sadeh <yehuda@inktank.com>
Sat, 3 May 2014 15:32:59 +0000 (08:32 -0700)
committerJohn Spray <john.spray@redhat.com>
Mon, 25 Aug 2014 00:33:39 +0000 (01:33 +0100)
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/common/RWLock.h

index fd7d4a8030f082bab07db8c7c8582a924fee040c..eb2faaaf7c0bdd8fce79a7ed29b4377e2da35864 100644 (file)
@@ -102,6 +102,14 @@ public:
     unlock();
   }
 
+  void get(bool for_write) {
+    if (for_write) {
+      get_write();
+    } else {
+      get_read();
+    }
+  }
+
 public:
   class RLocker {
     const RWLock &m_lock;