}
assert(gather.has_subs());
- gather.set_finisher(new FunctionContext([this, expire_to](int r){
- if (lock.is_locked_by_me()) {
- // Fast completion, Objecter ops completed before we hit gather.activate()
- // and we're being called inline. We are still inside _consume so
- // no need to call back into it.
- _execute_item_complete(expire_to);
- } else {
- // Normal completion, we're being called back from outside PurgeQueue::lock
- // by the Objecter. Take the lock, and call back into _consume to
- // find more work.
- Mutex::Locker l(lock);
- _execute_item_complete(expire_to);
+ gather.set_finisher(new C_OnFinisher(
+ new FunctionContext([this, expire_to](int r){
+ Mutex::Locker l(lock);
+ _execute_item_complete(expire_to);
- _consume();
- }
+ _consume();
// Have we gone idle? If so, do an extra write_head now instead of
// waiting for next flush after journaler_write_head_interval.
journaler.trim();
}));
}
- }));
+ }), &finisher));
+
gather.activate();
}