]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/strand_executor_service.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / detail / strand_executor_service.hpp
index d710927bf048a5f4e4681bc6b729cc8d6fdf73ed..2ec7be0243a73eb8ca3e02325ddfb57567dd60ad 100644 (file)
@@ -23,6 +23,8 @@
 #include <boost/asio/detail/op_queue.hpp>
 #include <boost/asio/detail/scheduler_operation.hpp>
 #include <boost/asio/detail/scoped_ptr.hpp>
+#include <boost/asio/detail/type_traits.hpp>
+#include <boost/asio/execution.hpp>
 #include <boost/asio/execution_context.hpp>
 
 #include <boost/asio/detail/push_options.hpp>
@@ -86,6 +88,22 @@ public:
   // Create a new strand_executor implementation.
   BOOST_ASIO_DECL implementation_type create_implementation();
 
+  // Request invocation of the given function.
+  template <typename Executor, typename Function>
+  static void execute(const implementation_type& impl, Executor& ex,
+      BOOST_ASIO_MOVE_ARG(Function) function,
+      typename enable_if<
+        can_query<Executor, execution::allocator_t<void> >::value
+      >::type* = 0);
+
+  // Request invocation of the given function.
+  template <typename Executor, typename Function>
+  static void execute(const implementation_type& impl, Executor& ex,
+      BOOST_ASIO_MOVE_ARG(Function) function,
+      typename enable_if<
+        !can_query<Executor, execution::allocator_t<void> >::value
+      >::type* = 0);
+
   // Request invocation of the given function.
   template <typename Executor, typename Function, typename Allocator>
   static void dispatch(const implementation_type& impl, Executor& ex,
@@ -107,12 +125,18 @@ public:
 
 private:
   friend class strand_impl;
-  template <typename Executor> class invoker;
+  template <typename F, typename Allocator> class allocator_binder;
+  template <typename Executor, typename = void> class invoker;
 
   // Adds a function to the strand. Returns true if it acquires the lock.
   BOOST_ASIO_DECL static bool enqueue(const implementation_type& impl,
       scheduler_operation* op);
 
+  // Helper function to request invocation of the given function.
+  template <typename Executor, typename Function, typename Allocator>
+  static void do_execute(const implementation_type& impl, Executor& ex,
+      BOOST_ASIO_MOVE_ARG(Function) function, const Allocator& a);
+
   // Mutex to protect access to the service-wide state.
   mutex mutex_;