enum { W_LOCK, R_LOCK, E_LOCK, NONE } lock_to_release;
- Context *on_finish;
-
OpContext(const OpContext& other);
const OpContext& operator=(const OpContext& other);
async_read_result(0),
inflightreads(0),
lock_to_release(NONE),
- on_finish(NULL),
release_snapset_obc(false) {
if (obc->ssc) {
new_snapset = obc->ssc->snapset;
async_read_result(0),
inflightreads(0),
lock_to_release(NONE),
- on_finish(NULL),
release_snapset_obc(false) { }
void reset_obs(ObjectContextRef obc) {
new_obs = ObjectState(obc->obs.oi, obc->obs.exists);
pending_async_reads.erase(i++)) {
delete i->second.second;
}
- assert(on_finish == NULL);
- }
- void finish(int r) {
- if (on_finish) {
- on_finish->complete(r);
- on_finish = NULL;
- }
}
};
using OpContextUPtr = std::unique_ptr<OpContext>;
ctx->on_finish.erase(p++)) {
(*p)();
}
- ctx->finish(r);
delete ctx;
}