]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/RefCountedObj: Mutex -> ceph::mutex
authorSage Weil <sage@redhat.com>
Tue, 16 Oct 2018 18:33:20 +0000 (13:33 -0500)
committerKefu Chai <kchai@redhat.com>
Wed, 21 Nov 2018 03:56:33 +0000 (11:56 +0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/RefCountedObj.h
src/journal/FutureImpl.h
src/msg/Message.h

index 3572945d71c7ecfa0b154cdeab889164d3cd2c69..2fcb3700167400b498f454964d09050856a69c9b 100644 (file)
 #ifndef CEPH_REFCOUNTEDOBJ_H
 #define CEPH_REFCOUNTEDOBJ_H
  
-#include "common/Mutex.h"
-#include "common/Cond.h"
+#include "common/ceph_mutex.h"
 #include "common/ceph_context.h"
 #include "common/valgrind.h"
+#include "common/debug.h"
 
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 
@@ -83,25 +83,25 @@ public:
 
 struct RefCountedCond : public RefCountedObject {
   bool complete;
-  Mutex lock;
-  Cond cond;
+  ceph::mutex lock = ceph::make_mutex("RefCountedCond::lock");
+  ceph::condition_variable cond;
   int rval;
 
-  RefCountedCond() : complete(false), lock("RefCountedCond"), rval(0) {}
+  RefCountedCond() : complete(false), rval(0) {}
 
   int wait() {
-    std::lock_guard<Mutex> l(lock);
+    std::unique_lock l(lock);
     while (!complete) {
-      cond.Wait(lock);
+      cond.wait(l);
     }
     return rval;
   }
 
   void done(int r) {
-    std::lock_guard<Mutex> l(lock);
+    std::lock_guard l(lock);
     rval = r;
     complete = true;
-    cond.SignalAll();
+    cond.notify_all();
   }
 
   void done() {
index 1f56a4ad567025cc02716a6ce76b6dbf7691831e..2be3eb253eccf1818cd22852aa91bb556a44e09e 100644 (file)
@@ -7,6 +7,7 @@
 #include "include/int_types.h"
 #include "common/Mutex.h"
 #include "common/RefCountedObj.h"
+#include "include/Context.h"
 #include "journal/Future.h"
 #include <list>
 #include <map>
index 02d1e95ed966e10356241d8df793cad0d91bad45..0fb759f3a0961bf43c4ded74279d321f3242d3dd 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <boost/intrusive/list.hpp>
 
+#include "include/Context.h"
 #include "common/RefCountedObj.h"
 #include "common/ThrottleInterface.h"
 #include "common/config.h"