]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/aio: YieldingAioThrottle::async_wait() uses async_initiate
authorCasey Bodley <cbodley@redhat.com>
Thu, 15 Feb 2024 03:51:25 +0000 (22:51 -0500)
committerCasey Bodley <cbodley@redhat.com>
Mon, 13 May 2024 16:13:40 +0000 (12:13 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_aio_throttle.cc

index d5574ddc4c2c5a319533ff09db44b7746013bced..0983e1bc4532e3218eec035d9566cd311221c783 100644 (file)
@@ -111,12 +111,12 @@ AioResultList BlockingAioThrottle::drain()
 template <typename CompletionToken>
 auto YieldingAioThrottle::async_wait(CompletionToken&& token)
 {
-  using boost::asio::async_completion;
   using Signature = void(boost::system::error_code);
-  async_completion<CompletionToken, Signature> init(token);
-  completion = Completion::create(context.get_executor(),
-                                  std::move(init.completion_handler));
-  return init.result.get();
+  return boost::asio::async_initiate<CompletionToken, Signature>(
+      [this] (auto handler) {
+        completion = Completion::create(yield.get_executor(),
+                                        std::move(handler));
+      }, token);
 }
 
 AioResultList YieldingAioThrottle::get(rgw_raw_obj obj,