2 // impl/execution_context.ipp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_IMPL_EXECUTION_CONTEXT_IPP
12 #define BOOST_ASIO_IMPL_EXECUTION_CONTEXT_IPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/execution_context.hpp>
20 #include <boost/asio/detail/service_registry.hpp>
22 #include <boost/asio/detail/push_options.hpp>
27 execution_context::execution_context()
28 : service_registry_(new boost::asio::detail::service_registry(*this))
32 execution_context::~execution_context()
36 delete service_registry_;
39 void execution_context::shutdown()
41 service_registry_->shutdown_services();
44 void execution_context::destroy()
46 service_registry_->destroy_services();
49 void execution_context::notify_fork(
50 boost::asio::execution_context::fork_event event)
52 service_registry_->notify_fork(event);
55 execution_context::service::service(execution_context& owner)
61 execution_context::service::~service()
65 void execution_context::service::notify_fork(execution_context::fork_event)
69 service_already_exists::service_already_exists()
70 : std::logic_error("Service already exists.")
74 invalid_service_owner::invalid_service_owner()
75 : std::logic_error("Invalid service owner.")
82 #include <boost/asio/detail/pop_options.hpp>
84 #endif // BOOST_ASIO_IMPL_EXECUTION_CONTEXT_IPP