]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/beast/core/async_base.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / beast / core / async_base.hpp
index c57603083459ec8c87fcadd6fa8366b2ddceea6d..1aa312675d76ee67bdac68fa277b95f0d6367d5c 100644 (file)
 #include <boost/beast/core/bind_handler.hpp>
 #include <boost/beast/core/detail/allocator.hpp>
 #include <boost/beast/core/detail/async_base.hpp>
+#include <boost/beast/core/detail/work_guard.hpp>
 #include <boost/asio/associated_allocator.hpp>
 #include <boost/asio/associated_executor.hpp>
 #include <boost/asio/bind_executor.hpp>
-#include <boost/asio/executor_work_guard.hpp>
 #include <boost/asio/handler_alloc_hook.hpp>
 #include <boost/asio/handler_continuation_hook.hpp>
 #include <boost/asio/handler_invoke_hook.hpp>
@@ -182,11 +182,31 @@ class async_base
 #endif
 {
     static_assert(
-        net::is_executor<Executor1>::value,
+        net::is_executor<Executor1>::value || net::execution::is_executor<Executor1>::value,
         "Executor type requirements not met");
 
     Handler h_;
-    net::executor_work_guard<Executor1> wg1_;
+    detail::select_work_guard_t<Executor1> wg1_;
+
+public:
+    /** The type of executor associated with this object.
+
+    If a class derived from @ref async_base is a completion
+    handler, then the associated executor of the derived class will
+    be this type.
+*/
+    using executor_type =
+#if BOOST_BEAST_DOXYGEN
+        __implementation_defined__;
+#else
+        typename
+        net::associated_executor<
+            Handler,
+            typename detail::select_work_guard_t<Executor1>::executor_type
+                >::type;
+#endif
+
+private:
 
     virtual
     void
@@ -229,7 +249,7 @@ public:
         Handler_&& handler,
         Executor1 const& ex1)
         : h_(std::forward<Handler_>(handler))
-        , wg1_(ex1)
+        , wg1_(detail::make_work_guard(ex1))
     {
     }
 
@@ -262,15 +282,6 @@ public:
     using allocator_type =
         net::associated_allocator_t<Handler, Allocator>;
 
-    /** The type of executor associated with this object.
-
-        If a class derived from @ref async_base is a completion
-        handler, then the associated executor of the derived class will
-        be this type.
-    */
-    using executor_type =
-        net::associated_executor_t<Handler, Executor1>;
-
     /** Returns the allocator associated with this object.
 
         If a class derived from @ref async_base is a completion