diff options
Diffstat (limited to 'boost/asio/detail/descriptor_read_op.hpp')
-rw-r--r-- | boost/asio/detail/descriptor_read_op.hpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/boost/asio/detail/descriptor_read_op.hpp b/boost/asio/detail/descriptor_read_op.hpp index 328e2191c0..3ced62bb26 100644 --- a/boost/asio/detail/descriptor_read_op.hpp +++ b/boost/asio/detail/descriptor_read_op.hpp @@ -2,7 +2,7 @@ // detail/descriptor_read_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -67,20 +67,21 @@ private: MutableBufferSequence buffers_; }; -template <typename MutableBufferSequence, typename Handler> +template <typename MutableBufferSequence, typename Handler, typename IoExecutor> class descriptor_read_op : public descriptor_read_op_base<MutableBufferSequence> { public: BOOST_ASIO_DEFINE_HANDLER_PTR(descriptor_read_op); - descriptor_read_op(int descriptor, - const MutableBufferSequence& buffers, Handler& handler) + descriptor_read_op(int descriptor, const MutableBufferSequence& buffers, + Handler& handler, const IoExecutor& io_ex) : descriptor_read_op_base<MutableBufferSequence>( descriptor, buffers, &descriptor_read_op::do_complete), - handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)) + handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)), + io_executor_(io_ex) { - handler_work<Handler>::start(handler_); + handler_work<Handler, IoExecutor>::start(handler_, io_executor_); } static void do_complete(void* owner, operation* base, @@ -90,7 +91,7 @@ public: // Take ownership of the handler object. descriptor_read_op* o(static_cast<descriptor_read_op*>(base)); ptr p = { boost::asio::detail::addressof(o->handler_), o, o }; - handler_work<Handler> w(o->handler_); + handler_work<Handler, IoExecutor> w(o->handler_, o->io_executor_); BOOST_ASIO_HANDLER_COMPLETION((*o)); @@ -117,6 +118,7 @@ public: private: Handler handler_; + IoExecutor io_executor_; }; } // namespace detail |