diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp b/3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp index e456bb9..6a384e4 100644 --- a/3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp +++ b/3rdParty/Boost/src/boost/asio/detail/impl/resolver_service_base.ipp @@ -2,7 +2,7 @@ // detail/impl/resolver_service_base.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 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) @@ -53,10 +53,10 @@ resolver_service_base::~resolver_service_base() void resolver_service_base::shutdown_service() { work_.reset(); - if (work_io_service_) + if (work_io_service_.get()) { work_io_service_->stop(); - if (work_thread_) + if (work_thread_.get()) { work_thread_->join(); work_thread_.reset(); @@ -65,6 +65,25 @@ void resolver_service_base::shutdown_service() } } +void resolver_service_base::fork_service( + boost::asio::io_service::fork_event fork_ev) +{ + if (work_thread_.get()) + { + if (fork_ev == boost::asio::io_service::fork_prepare) + { + work_io_service_->stop(); + work_thread_->join(); + } + else + { + work_io_service_->reset(); + work_thread_.reset(new boost::asio::detail::thread( + work_io_service_runner(*work_io_service_))); + } + } +} + void resolver_service_base::construct( resolver_service_base::implementation_type& impl) { @@ -72,13 +91,18 @@ void resolver_service_base::construct( } void resolver_service_base::destroy( - resolver_service_base::implementation_type&) + resolver_service_base::implementation_type& impl) { + BOOST_ASIO_HANDLER_OPERATION(("resolver", &impl, "cancel")); + + impl.reset(); } void resolver_service_base::cancel( resolver_service_base::implementation_type& impl) { + BOOST_ASIO_HANDLER_OPERATION(("resolver", &impl, "cancel")); + impl.reset(static_cast<void*>(0), socket_ops::noop_deleter()); } @@ -92,7 +116,7 @@ void resolver_service_base::start_resolve_op(operation* op) void resolver_service_base::start_work_thread() { boost::asio::detail::mutex::scoped_lock lock(mutex_); - if (!work_thread_) + if (!work_thread_.get()) { work_thread_.reset(new boost::asio::detail::thread( work_io_service_runner(*work_io_service_))); |