class Waiter {
using Signature = void(boost::system::error_code);
using Completion = ceph::async::Completion<Signature>;
- using CompletionInit = boost::asio::async_completion<spawn::yield_context, Signature>;
std::unique_ptr<Completion> completion = nullptr;
int ret;
}
if (y) {
boost::system::error_code ec;
- auto&& token = y.get_yield_context()[ec];
- CompletionInit init(token);
- completion = Completion::create(y.get_io_context().get_executor(),
- std::move(init.completion_handler));
+ auto yield = y.get_yield_context();
+ auto&& token = yield[ec];
+ boost::asio::async_initiate<spawn::yield_context, Signature>(
+ [this] (auto handler, auto ex) {
+ completion = Completion::create(ex, std::move(handler));
+ }, token, yield.get_executor());
l.unlock();
- init.result.get();
return -ec.value();
}
cond.wait(l, [this]{return (done==true);});