}
TestIoCtxImpl::~TestIoCtxImpl() {
- assert(m_pending_ops.read() == 0);
+ assert(m_pending_ops == 0);
}
void TestObjectOperationImpl::get() {
- m_refcount.inc();
+ m_refcount++;
}
void TestObjectOperationImpl::put() {
- if (m_refcount.dec() == 0) {
+ if (--m_refcount == 0) {
ANNOTATE_HAPPENS_AFTER(&m_refcount);
ANNOTATE_HAPPENS_BEFORE_FORGET_ALL(&m_refcount);
delete this;
}
void TestIoCtxImpl::get() {
- m_refcount.inc();
+ m_refcount++;
}
void TestIoCtxImpl::put() {
- if (m_refcount.dec() == 0) {
+ if (--m_refcount == 0) {
m_client->put();
delete this;
}
void TestIoCtxImpl::aio_notify(const std::string& oid, AioCompletionImpl *c,
bufferlist& bl, uint64_t timeout_ms,
bufferlist *pbl) {
- m_pending_ops.inc();
+ m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
m_client->get_watch_notify()->aio_notify(m_client, oid, bl, timeout_ms, pbl,
int flags) {
// TODO flags for now
ops.get();
- m_pending_ops.inc();
+ m_pending_ops++;
m_client->add_aio_operation(oid, true, boost::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops,
reinterpret_cast<bufferlist*>(0),
bufferlist *pbl) {
// TODO ignoring flags for now
ops.get();
- m_pending_ops.inc();
+ m_pending_ops++;
m_client->add_aio_operation(oid, true, boost::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl, m_snapc), c);
return 0;
int TestIoCtxImpl::aio_watch(const std::string& o, AioCompletionImpl *c,
uint64_t *handle, librados::WatchCtx2 *watch_ctx) {
- m_pending_ops.inc();
+ m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
if (m_client->is_blacklisted()) {
}
int TestIoCtxImpl::aio_unwatch(uint64_t handle, AioCompletionImpl *c) {
- m_pending_ops.inc();
+ m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
if (m_client->is_blacklisted()) {
AioCompletionImpl *comp = new AioCompletionImpl();
ops.get();
- m_pending_ops.inc();
+ m_pending_ops++;
m_client->add_aio_operation(oid, false, boost::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops,
reinterpret_cast<bufferlist*>(0), m_snapc), comp);
AioCompletionImpl *comp = new AioCompletionImpl();
ops.get();
- m_pending_ops.inc();
+ m_pending_ops++;
m_client->add_aio_operation(oid, false, boost::bind(
&TestIoCtxImpl::execute_aio_operations, this, oid, &ops, pbl,
m_snapc), comp);
}
}
}
- m_pending_ops.dec();
+ m_pending_ops--;
ops->put();
return ret;
}
void TestIoCtxImpl::handle_aio_notify_complete(AioCompletionImpl *c, int r) {
- m_pending_ops.dec();
+ m_pending_ops--;
m_client->finish_aio_completion(c, r);
}