/usr/include/boost/asio/impl
NameSizeModeActions
awaitable.hpp117480644editdlrm
buffered_read_stream.hpp169250644editdlrm
buffered_write_stream.hpp164290644editdlrm
compose.hpp204610644editdlrm
connect.hpp322340644editdlrm
co_spawn.hpp88340644editdlrm
defer.hpp78030644editdlrm
detached.hpp33740644editdlrm
dispatch.hpp75670644editdlrm
error.ipp30700644editdlrm
execution_context.hpp32470644editdlrm
execution_context.ipp18010644editdlrm
executor.hpp68350644editdlrm
executor.ipp10020644editdlrm
handler_alloc_hook.ipp19840644editdlrm
io_context.hpp137280644editdlrm
io_context.ipp41080644editdlrm
multiple_exceptions.ipp12800644editdlrm
post.hpp77620644editdlrm
read.hpp451780644editdlrm
read_at.hpp283310644editdlrm
read_until.hpp1153350644editdlrm
redirect_error.hpp120150644editdlrm
serial_port_base.hpp13750644editdlrm
serial_port_base.ipp133270644editdlrm
spawn.hpp158540644editdlrm
src.hpp38330644editdlrm
system_context.hpp8750644editdlrm
system_context.ipp21090644editdlrm
system_executor.hpp63910644editdlrm
thread_pool.hpp108530644editdlrm
thread_pool.ipp31320644editdlrm
use_awaitable.hpp72440644editdlrm
use_future.hpp276100644editdlrm
write.hpp410760644editdlrm
write_at.hpp247320644editdlrm
Edit: /usr/include/boost/asio/impl/system_executor.hpp (6391B)
// // impl/system_executor.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~ // // 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) // #ifndef BOOST_ASIO_IMPL_SYSTEM_EXECUTOR_HPP #define BOOST_ASIO_IMPL_SYSTEM_EXECUTOR_HPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include #include #include #include namespace boost { namespace asio { template inline system_context& basic_system_executor::query( execution::context_t) BOOST_ASIO_NOEXCEPT { return detail::global(); } template inline std::size_t basic_system_executor::query( execution::occupancy_t) const BOOST_ASIO_NOEXCEPT { return detail::global().num_threads_; } template template inline void basic_system_executor::do_execute( BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::possibly_t) const { // Obtain a non-const instance of the function. detail::non_const_lvalue f2(f); #if !defined(BOOST_ASIO_NO_EXCEPTIONS) try { #endif// !defined(BOOST_ASIO_NO_EXCEPTIONS) detail::fenced_block b(detail::fenced_block::full); boost_asio_handler_invoke_helpers::invoke(f2.value, f2.value); #if !defined(BOOST_ASIO_NO_EXCEPTIONS) } catch (...) { std::terminate(); } #endif// !defined(BOOST_ASIO_NO_EXCEPTIONS) } template template inline void basic_system_executor::do_execute( BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::always_t) const { // Obtain a non-const instance of the function. detail::non_const_lvalue f2(f); #if !defined(BOOST_ASIO_NO_EXCEPTIONS) try { #endif// !defined(BOOST_ASIO_NO_EXCEPTIONS) detail::fenced_block b(detail::fenced_block::full); boost_asio_handler_invoke_helpers::invoke(f2.value, f2.value); #if !defined(BOOST_ASIO_NO_EXCEPTIONS) } catch (...) { std::terminate(); } #endif// !defined(BOOST_ASIO_NO_EXCEPTIONS) } template template void basic_system_executor::do_execute( BOOST_ASIO_MOVE_ARG(Function) f, execution::blocking_t::never_t) const { system_context& ctx = detail::global(); // Allocate and construct an operation to wrap the function. typedef typename decay::type function_type; typedef detail::executor_op op; typename op::ptr p = { detail::addressof(allocator_), op::ptr::allocate(allocator_), 0 }; p.p = new (p.v) op(BOOST_ASIO_MOVE_CAST(Function)(f), allocator_); if (is_same::value) { BOOST_ASIO_HANDLER_CREATION((ctx, *p.p, "system_executor", &ctx, 0, "execute(blk=never,rel=cont)")); } else { BOOST_ASIO_HANDLER_CREATION((ctx, *p.p, "system_executor", &ctx, 0, "execute(blk=never,rel=fork)")); } ctx.scheduler_.post_immediate_completion(p.p, is_same::value); p.v = p.p = 0; } #if !defined(BOOST_ASIO_NO_TS_EXECUTORS) template inline system_context& basic_system_executor< Blocking, Relationship, Allocator>::context() const BOOST_ASIO_NOEXCEPT { return detail::global(); } template template void basic_system_executor::dispatch( BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator&) const { typename decay::type tmp(BOOST_ASIO_MOVE_CAST(Function)(f)); boost_asio_handler_invoke_helpers::invoke(tmp, tmp); } template template void basic_system_executor::post( BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const { typedef typename decay::type function_type; system_context& ctx = detail::global(); // Allocate and construct an operation to wrap the function. typedef detail::executor_op op; typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; p.p = new (p.v) op(BOOST_ASIO_MOVE_CAST(Function)(f), a); BOOST_ASIO_HANDLER_CREATION((ctx, *p.p, "system_executor", &this->context(), 0, "post")); ctx.scheduler_.post_immediate_completion(p.p, false); p.v = p.p = 0; } template template void basic_system_executor::defer( BOOST_ASIO_MOVE_ARG(Function) f, const OtherAllocator& a) const { typedef typename decay::type function_type; system_context& ctx = detail::global(); // Allocate and construct an operation to wrap the function. typedef detail::executor_op op; typename op::ptr p = { detail::addressof(a), op::ptr::allocate(a), 0 }; p.p = new (p.v) op(BOOST_ASIO_MOVE_CAST(Function)(f), a); BOOST_ASIO_HANDLER_CREATION((ctx, *p.p, "system_executor", &this->context(), 0, "defer")); ctx.scheduler_.post_immediate_completion(p.p, true); p.v = p.p = 0; } #endif // !defined(BOOST_ASIO_NO_TS_EXECUTORS) } // namespace asio } // namespace boost #include #endif // BOOST_ASIO_IMPL_SYSTEM_EXECUTOR_HPP