From: Sage Weil Date: Tue, 16 Oct 2018 18:33:20 +0000 (-0500) Subject: common/RefCountedObj: Mutex -> ceph::mutex X-Git-Tag: v14.1.0~820^2~27 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5537e6ee45ae6fed8a2affc4d17f95d6d0d46bb1;p=ceph-ci.git common/RefCountedObj: Mutex -> ceph::mutex Signed-off-by: Sage Weil --- diff --git a/src/common/RefCountedObj.h b/src/common/RefCountedObj.h index 3572945d71c..2fcb3700167 100644 --- a/src/common/RefCountedObj.h +++ b/src/common/RefCountedObj.h @@ -15,10 +15,10 @@ #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 @@ -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 l(lock); + std::unique_lock l(lock); while (!complete) { - cond.Wait(lock); + cond.wait(l); } return rval; } void done(int r) { - std::lock_guard l(lock); + std::lock_guard l(lock); rval = r; complete = true; - cond.SignalAll(); + cond.notify_all(); } void done() { diff --git a/src/journal/FutureImpl.h b/src/journal/FutureImpl.h index 1f56a4ad567..2be3eb253ec 100644 --- a/src/journal/FutureImpl.h +++ b/src/journal/FutureImpl.h @@ -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 #include diff --git a/src/msg/Message.h b/src/msg/Message.h index 02d1e95ed96..0fb759f3a09 100644 --- a/src/msg/Message.h +++ b/src/msg/Message.h @@ -20,6 +20,7 @@ #include +#include "include/Context.h" #include "common/RefCountedObj.h" #include "common/ThrottleInterface.h" #include "common/config.h"