]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/spawn.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / spawn.hpp
index 093b4ec35076e93a998fe117e71aa6b02002b2d2..6bcc94702150a987b6edfbf6d931f055027f2099 100644 (file)
@@ -2,7 +2,7 @@
 // spawn.hpp
 // ~~~~~~~~~
 //
-// Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2020 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)
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/coroutine/all.hpp>
+#include <boost/asio/any_io_executor.hpp>
 #include <boost/asio/bind_executor.hpp>
 #include <boost/asio/detail/memory.hpp>
 #include <boost/asio/detail/type_traits.hpp>
 #include <boost/asio/detail/wrapped_handler.hpp>
-#include <boost/asio/executor.hpp>
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/is_executor.hpp>
 #include <boost/asio/strand.hpp>
@@ -152,7 +152,7 @@ private:
 typedef basic_yield_context<unspecified> yield_context;
 #else // defined(GENERATING_DOCUMENTATION)
 typedef basic_yield_context<
-  executor_binder<void(*)(), executor> > yield_context;
+  executor_binder<void(*)(), any_io_executor> > yield_context;
 #endif // defined(GENERATING_DOCUMENTATION)
 
 /**
@@ -226,7 +226,9 @@ void spawn(BOOST_ASIO_MOVE_ARG(Handler) handler,
     BOOST_ASIO_MOVE_ARG(Function) function,
     const boost::coroutines::attributes& attributes
       = boost::coroutines::attributes(),
-    typename enable_if<!is_executor<typename decay<Handler>::type>::value &&
+    typename enable_if<
+      !is_executor<typename decay<Handler>::type>::value &&
+      !execution::is_executor<typename decay<Handler>::type>::value &&
       !is_convertible<Handler&, execution_context&>::value>::type* = 0);
 
 /// Start a new stackful coroutine, inheriting the execution context of another.
@@ -267,7 +269,9 @@ void spawn(const Executor& ex,
     BOOST_ASIO_MOVE_ARG(Function) function,
     const boost::coroutines::attributes& attributes
       = boost::coroutines::attributes(),
-    typename enable_if<is_executor<Executor>::value>::type* = 0);
+    typename enable_if<
+      is_executor<Executor>::value || execution::is_executor<Executor>::value
+    >::type* = 0);
 
 /// Start a new stackful coroutine that executes on a given strand.
 /**
@@ -286,6 +290,8 @@ void spawn(const strand<Executor>& ex,
     const boost::coroutines::attributes& attributes
       = boost::coroutines::attributes());
 
+#if !defined(BOOST_ASIO_NO_TS_EXECUTORS)
+
 /// Start a new stackful coroutine that executes in the context of a strand.
 /**
  * This function is used to launch a new coroutine.
@@ -305,6 +311,8 @@ void spawn(const boost::asio::io_context::strand& s,
     const boost::coroutines::attributes& attributes
       = boost::coroutines::attributes());
 
+#endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS)
+
 /// Start a new stackful coroutine that executes on a given execution context.
 /**
  * This function is used to launch a new coroutine.