#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>
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() {
#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>
#include <boost/intrusive/list.hpp>
+#include "include/Context.h"
#include "common/RefCountedObj.h"
#include "common/ThrottleInterface.h"
#include "common/config.h"