#include <boost/thread.hpp>
#include <errno.h>
+#include <atomic>
+
static int get_concurrency() {
int concurrency = 0;
char *env = getenv("LIBRADOS_CONCURRENCY");
}
void TestRadosClient::get() {
- m_refcount.inc();
+ m_refcount++;
}
void TestRadosClient::put() {
- if (m_refcount.dec() == 0) {
+ if (--m_refcount == 0) {
shutdown();
delete this;
}
struct WaitForFlush {
int flushed() {
- if (count.dec() == 0) {
+ if (--count == 0) {
aio_finisher->queue(new FunctionContext(boost::bind(
&finish_aio_completion, c, 0)));
delete this;
return 0;
}
- atomic_t count;
+ std::atomic<int64_t> count = { 0 };
Finisher *aio_finisher;
AioCompletionImpl *c;
};
c->get();
WaitForFlush *wait_for_flush = new WaitForFlush();
- wait_for_flush->count.set(m_finishers.size());
+ wait_for_flush->count = m_finishers.size();
wait_for_flush->aio_finisher = m_aio_finisher;
wait_for_flush->c = c;