Subject: [Boost-bugs] [Boost C++ Libraries] #5007: boost 1.42, asio async_resolve add thread exit method
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-12-20 14:40:35
#5007: boost 1.42, asio async_resolve add thread exit method
-------------------------------------------------+--------------------------
Reporter: gongyiling <gongyiling3468@â¦> | Owner: chris_kohlhoff
Type: Patches | Status: new
Milestone: To Be Determined | Component: asio
Version: Boost 1.42.0 | Severity: Problem
Keywords: boost asio resolve thread |
-------------------------------------------------+--------------------------
In our project, we use boost::asio::ip::tcp::resolver as DNS resolver, but
found a problem, that is: a thread was created during the resolving
process, and didn't quit when resolve finished, making it hard to slim
project's threads number.
so, I dig into the source code, blabla, and fixed this "problem"
i'm new to this stuff, so to be good, i paste diff code here:
{{{
diff -urN asio_old/ip/basic_resolver.hpp asio/ip/basic_resolver.hpp
--- asio_old/ip/basic_resolver.hpp 2010-01-04 04:36:02.000000000
+0800
+++ asio/ip/basic_resolver.hpp 2010-12-20 22:02:33.369834300 +0800
@@ -237,6 +237,11 @@
{
return this->service.async_resolve(this->implementation, e, handler);
}
+
+ void shutdown_service()
+ {
+ this->service.shutdown_service();
+ }
};
} // namespace ip
diff -urN asio_old/ip/resolver_service.hpp asio/ip/resolver_service.hpp
--- asio_old/ip/resolver_service.hpp 2010-01-04 04:36:02.000000000
+0800
+++ asio/ip/resolver_service.hpp 2010-12-20 21:56:38.610543300
+0800
@@ -78,6 +78,7 @@
/// Destroy all user-defined handler objects owned by the service.
void shutdown_service()
{
+ service_impl_.shutdown_service();
}
/// Construct a new resolver implementation.
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5007> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC