]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/impl/executor.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / asio / impl / executor.hpp
index 106763b042a1e70630f6776aca61e2c0c40707f8..b1c6cd748f11b838420f2cbac8ada99fd5e3beeb 100644 (file)
@@ -2,7 +2,7 @@
 // impl/executor.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)
@@ -17,7 +17,7 @@
 
 #include <boost/asio/detail/config.hpp>
 #include <boost/asio/detail/atomic_count.hpp>
-#include <boost/asio/detail/executor_op.hpp>
+#include <boost/asio/detail/executor_function.hpp>
 #include <boost/asio/detail/global.hpp>
 #include <boost/asio/detail/memory.hpp>
 #include <boost/asio/detail/recycling_allocator.hpp>
@@ -41,36 +41,37 @@ public:
   explicit function(F f, const Alloc& a)
   {
     // Allocate and construct an operation to wrap the function.
-    typedef detail::executor_op<F, Alloc> op;
-    typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 };
-    op_ = new (p.v) op(BOOST_ASIO_MOVE_CAST(F)(f), a);
+    typedef detail::executor_function<F, Alloc> func_type;
+    typename func_type::ptr p = {
+      detail::addressof(a), func_type::ptr::allocate(a), 0 };
+    func_ = new (p.v) func_type(BOOST_ASIO_MOVE_CAST(F)(f), a);
     p.v = 0;
   }
 
-  function(function&& other)
-    : op_(other.op_)
+  function(function&& other) BOOST_ASIO_NOEXCEPT
+    : func_(other.func_)
   {
-    other.op_ = 0;
+    other.func_ = 0;
   }
 
   ~function()
   {
-    if (op_)
-      op_->destroy();
+    if (func_)
+      func_->destroy();
   }
 
   void operator()()
   {
-    if (op_)
+    if (func_)
     {
-      detail::scheduler_operation* op = op_;
-      op_ = 0;
-      op->complete(this, boost::system::error_code(), 0);
+      detail::executor_function_base* func = func_;
+      func_ = 0;
+      func->complete();
     }
   }
 
 private:
-  detail::scheduler_operation* op_;
+  detail::executor_function_base* func_;
 };
 
 #else // defined(BOOST_ASIO_HAS_MOVE)