From: Casey Bodley Date: Thu, 15 Feb 2024 03:51:25 +0000 (-0500) Subject: rgw/aio: YieldingAioThrottle::async_wait() uses async_initiate X-Git-Tag: v19.2.1~172^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=51ec4c4021d0732e74ed2f0fb75c220edbdb310e;p=ceph.git rgw/aio: YieldingAioThrottle::async_wait() uses async_initiate Signed-off-by: Casey Bodley (cherry picked from commit 911735290919e84429984b4342dd17bb445187a1) --- diff --git a/src/rgw/rgw_aio_throttle.cc b/src/rgw/rgw_aio_throttle.cc index d5574ddc4c2c..0983e1bc4532 100644 --- a/src/rgw/rgw_aio_throttle.cc +++ b/src/rgw/rgw_aio_throttle.cc @@ -111,12 +111,12 @@ AioResultList BlockingAioThrottle::drain() template auto YieldingAioThrottle::async_wait(CompletionToken&& token) { - using boost::asio::async_completion; using Signature = void(boost::system::error_code); - async_completion init(token); - completion = Completion::create(context.get_executor(), - std::move(init.completion_handler)); - return init.result.get(); + return boost::asio::async_initiate( + [this] (auto handler) { + completion = Completion::create(yield.get_executor(), + std::move(handler)); + }, token); } AioResultList YieldingAioThrottle::get(rgw_raw_obj obj,