summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/asio/include/asio/detail/resolver_service_base.hpp')
-rw-r--r--3rdparty/asio/include/asio/detail/resolver_service_base.hpp56
1 files changed, 37 insertions, 19 deletions
diff --git a/3rdparty/asio/include/asio/detail/resolver_service_base.hpp b/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
index e3dd4f7edd7..0df30f40607 100644
--- a/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
+++ b/3rdparty/asio/include/asio/detail/resolver_service_base.hpp
@@ -2,7 +2,7 @@
// detail/resolver_service_base.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2021 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)
@@ -17,8 +17,7 @@
#include "asio/detail/config.hpp"
#include "asio/error.hpp"
-#include "asio/executor_work_guard.hpp"
-#include "asio/io_context.hpp"
+#include "asio/execution_context.hpp"
#include "asio/detail/mutex.hpp"
#include "asio/detail/noncopyable.hpp"
#include "asio/detail/resolve_op.hpp"
@@ -27,6 +26,12 @@
#include "asio/detail/scoped_ptr.hpp"
#include "asio/detail/thread.hpp"
+#if defined(ASIO_HAS_IOCP)
+# include "asio/detail/win_iocp_io_context.hpp"
+#else // defined(ASIO_HAS_IOCP)
+# include "asio/detail/scheduler.hpp"
+#endif // defined(ASIO_HAS_IOCP)
+
#include "asio/detail/push_options.hpp"
namespace asio {
@@ -40,7 +45,7 @@ public:
typedef socket_ops::shared_cancel_token_type implementation_type;
// Constructor.
- ASIO_DECL resolver_service_base(asio::io_context& io_context);
+ ASIO_DECL resolver_service_base(execution_context& context);
// Destructor.
ASIO_DECL ~resolver_service_base();
@@ -50,7 +55,7 @@ public:
// Perform any fork-related housekeeping.
ASIO_DECL void base_notify_fork(
- asio::io_context::fork_event fork_ev);
+ execution_context::fork_event fork_ev);
// Construct a new resolver implementation.
ASIO_DECL void construct(implementation_type& impl);
@@ -67,6 +72,21 @@ public:
resolver_service_base& other_service,
implementation_type& other_impl);
+ // Move-construct a new timer implementation.
+ void converting_move_construct(implementation_type& impl,
+ resolver_service_base&, implementation_type& other_impl)
+ {
+ move_construct(impl, other_impl);
+ }
+
+ // Move-assign from another timer implementation.
+ void converting_move_assign(implementation_type& impl,
+ resolver_service_base& other_service,
+ implementation_type& other_impl)
+ {
+ move_assign(impl, other_service, other_impl);
+ }
+
// Cancel pending asynchronous operations.
ASIO_DECL void cancel(implementation_type& impl);
@@ -101,28 +121,26 @@ protected:
};
#endif // !defined(ASIO_WINDOWS_RUNTIME)
- // Helper class to run the work io_context in a thread.
- class work_io_context_runner;
+ // Helper class to run the work scheduler in a thread.
+ class work_scheduler_runner;
- // Start the work thread if it's not already running.
+ // Start the work scheduler if it's not already running.
ASIO_DECL void start_work_thread();
- // The io_context implementation used to post completions.
- io_context_impl& io_context_impl_;
+ // The scheduler implementation used to post completions.
+#if defined(ASIO_HAS_IOCP)
+ typedef class win_iocp_io_context scheduler_impl;
+#else
+ typedef class scheduler scheduler_impl;
+#endif
+ scheduler_impl& scheduler_;
private:
// Mutex to protect access to internal data.
asio::detail::mutex mutex_;
- // Private io_context used for performing asynchronous host resolution.
- asio::detail::scoped_ptr<asio::io_context> work_io_context_;
-
- // The work io_context implementation used to post completions.
- io_context_impl& work_io_context_impl_;
-
- // Work for the private io_context to perform.
- asio::executor_work_guard<
- asio::io_context::executor_type> work_;
+ // Private scheduler used for performing asynchronous host resolution.
+ asio::detail::scoped_ptr<scheduler_impl> work_scheduler_;
// Thread used for running the work io_context's run loop.
asio::detail::scoped_ptr<asio::detail::thread> work_thread_;