]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/win_iocp_null_buffers_op.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / detail / win_iocp_null_buffers_op.hpp
index f06156591eb02611c463512412f92d55c6406439..ec636dbd41757c1ae2132def9d0cc6824d6fbe3c 100644 (file)
 #if defined(BOOST_ASIO_HAS_IOCP)
 
 #include <boost/asio/detail/bind_handler.hpp>
-#include <boost/asio/detail/buffer_sequence_adapter.hpp>
 #include <boost/asio/detail/fenced_block.hpp>
 #include <boost/asio/detail/handler_alloc_helpers.hpp>
 #include <boost/asio/detail/handler_invoke_helpers.hpp>
+#include <boost/asio/detail/handler_work.hpp>
 #include <boost/asio/detail/memory.hpp>
 #include <boost/asio/detail/reactor_op.hpp>
 #include <boost/asio/detail/socket_ops.hpp>
@@ -43,13 +43,13 @@ public:
 
   win_iocp_null_buffers_op(socket_ops::weak_cancel_token_type cancel_token,
       Handler& handler, const IoExecutor& io_ex)
-    : reactor_op(&win_iocp_null_buffers_op::do_perform,
+    : reactor_op(boost::system::error_code(),
+        &win_iocp_null_buffers_op::do_perform,
         &win_iocp_null_buffers_op::do_complete),
       cancel_token_(cancel_token),
       handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
-      io_executor_(io_ex)
+      work_(handler_, io_ex)
   {
-    handler_work<Handler, IoExecutor>::start(handler_, io_executor_);
   }
 
   static status do_perform(reactor_op*)
@@ -66,10 +66,14 @@ public:
     // Take ownership of the operation object.
     win_iocp_null_buffers_op* o(static_cast<win_iocp_null_buffers_op*>(base));
     ptr p = { boost::asio::detail::addressof(o->handler_), o, o };
-    handler_work<Handler, IoExecutor> w(o->handler_, o->io_executor_);
 
     BOOST_ASIO_HANDLER_COMPLETION((*o));
 
+    // Take ownership of the operation's outstanding work.
+    handler_work<Handler, IoExecutor> w(
+        BOOST_ASIO_MOVE_CAST2(handler_work<Handler, IoExecutor>)(
+          o->work_));
+
     // The reactor may have stored a result in the operation object.
     if (o->ec_)
       ec = o->ec_;
@@ -111,7 +115,7 @@ public:
 private:
   socket_ops::weak_cancel_token_type cancel_token_;
   Handler handler_;
-  IoExecutor io_executor_;
+  handler_work<Handler, IoExecutor> work_;
 };
 
 } // namespace detail