Init drain_cr() before draining, otherwise we wouldn't be able to
call it a second time
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
RGWCoroutinesStack *stack = *iter;
if (!stack->is_done()) {
new_list.push_back(stack);
+ ldout(cct, 20) << "collect(): s=" << (void *)this << " stack=" << (void *)stack << " is still running" << dendl;
continue;
}
int r = stack->get_ret_status();
*ret = r;
}
+ ldout(cct, 20) << "collect(): s=" << (void *)this << " stack=" << (void *)stack << " is complete" << dendl;
stack->put();
}
{
rgw_spawned_stacks *s = (op ? &op->spawned : &spawned);
*ret = 0;
- vector<RGWCoroutinesStack *> new_list;
if (collected_stack) {
*collected_stack = NULL;
if (collected_stack) {
*collected_stack = stack;
- } else {
- stack->put();
}
+ stack->put();
s->entries.erase(iter);
return true;
} while (0)
#define drain_all() \
+ drain_cr = boost::asio::coroutine(); \
yield_until_true(drain_children(0))
#define drain_all_but(n) \
+ drain_cr = boost::asio::coroutine(); \
yield_until_true(drain_children(n))
template <class T>