src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp in passenger-6.0.19 vs src/cxx_supportlib/vendor-modified/boost/asio/defer.hpp in passenger-6.0.20
- old
+ new
@@ -1,10 +1,10 @@
//
// defer.hpp
// ~~~~~~~~~
//
-// Copyright (c) 2003-2022 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2023 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)
//
@@ -15,10 +15,11 @@
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
#include <boost/asio/async_result.hpp>
+#include <boost/asio/detail/initiate_defer.hpp>
#include <boost/asio/detail/type_traits.hpp>
#include <boost/asio/execution_context.hpp>
#include <boost/asio/execution/blocking.hpp>
#include <boost/asio/execution/executor.hpp>
#include <boost/asio/is_executor.hpp>
@@ -26,17 +27,11 @@
#include <boost/asio/detail/push_options.hpp>
namespace boost {
namespace asio {
-namespace detail {
-class initiate_defer;
-template <typename> class initiate_defer_with_executor;
-
-} // namespace detail
-
/// Submits a completion token or function object for execution.
/**
* This function submits an object for execution using the object's associated
* executor. The function object is queued for execution, and is never called
* from the current thread prior to returning from <tt>defer()</tt>.
@@ -87,11 +82,15 @@
template <BOOST_ASIO_COMPLETION_TOKEN_FOR(void()) NullaryToken>
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_PREFIX(NullaryToken, void()) defer(
BOOST_ASIO_MOVE_ARG(NullaryToken) token)
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX((
async_initiate<NullaryToken, void()>(
- declval<detail::initiate_defer>(), token)));
+ declval<detail::initiate_defer>(), token)))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer(), token);
+}
/// Submits a completion token or function object for execution.
/**
* This function submits an object for execution using the specified executor.
* The function object is queued for execution, and is never called from the
@@ -174,11 +173,15 @@
&& can_require<Executor, execution::blocking_t::never_t>::value)
|| is_executor<Executor>::value
>::type = 0)
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX((
async_initiate<NullaryToken, void()>(
- declval<detail::initiate_defer_with_executor<Executor> >(), token)));
+ declval<detail::initiate_defer_with_executor<Executor> >(), token)))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer_with_executor<Executor>(ex), token);
+}
/// Submits a completion token or function object for execution.
/**
* @param ctx An execution context, from which the target executor is obtained.
*
@@ -203,15 +206,19 @@
typename constraint<is_convertible<
ExecutionContext&, execution_context&>::value>::type = 0)
BOOST_ASIO_INITFN_AUTO_RESULT_TYPE_SUFFIX((
async_initiate<NullaryToken, void()>(
declval<detail::initiate_defer_with_executor<
- typename ExecutionContext::executor_type> >(), token)));
+ typename ExecutionContext::executor_type> >(), token)))
+{
+ return async_initiate<NullaryToken, void()>(
+ detail::initiate_defer_with_executor<
+ typename ExecutionContext::executor_type>(
+ ctx.get_executor()), token);
+}
} // namespace asio
} // namespace boost
#include <boost/asio/detail/pop_options.hpp>
-
-#include <boost/asio/impl/defer.hpp>
#endif // BOOST_ASIO_DEFER_HPP