// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
-#include "mds/mdstypes.h"
-#include "include/buffer.h"
-#include "include/rbd_types.h"
#include "include/rados/librados.h"
#include "include/rados/librados.hpp"
#include "include/stringify.h"
#include "test/librados/test.h"
-#include "common/Cond.h"
-
#include "gtest/gtest.h"
#include <errno.h>
+#include <condition_variable>
#include <map>
#include <sstream>
#include <string>
struct Log {
list<string> log;
- Cond cond;
- Mutex lock;
-
- Log() : lock("l::lock") {}
+ std::condition_variable cond;
+ std::mutex lock;
- bool contains(string str) {
- Mutex::Locker l(lock);
+ bool contains(const string& str) {
+ std::lock_guard<std::mutex> l(lock);
for (list<string>::iterator p = log.begin(); p != log.end(); ++p) {
if (p->find(str) != std::string::npos)
return true;
uint64_t seq, const char *level,
const char *msg) {
Log *l = static_cast<Log *>(arg);
- Mutex::Locker locker(l->lock);
+ std::lock_guard<std::mutex> locker(l->lock);
l->log.push_back(line);
- l->cond.Signal();
+ l->cond.notify_all();
cout << "got: " << line << std::endl;
}