Boost C++ Libraries: Ticket #5007: boost 1.42, asio async_resolve add thread exit method https://svn.boost.org/trac10/ticket/5007 <blockquote> <p> 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: </p> </blockquote> <pre class="wiki">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-&gt;service.async_resolve(this-&gt;implementation, e, handler); } + + void shutdown_service() + { + this-&gt;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. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5007 Trac 1.4.3 chris_kohlhoff Tue, 21 Dec 2010 02:16:02 GMT status, type, severity changed; resolution set https://svn.boost.org/trac10/ticket/5007#comment:1 https://svn.boost.org/trac10/ticket/5007#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>type</strong> <span class="trac-field-old">Patches</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Not Applicable</span> </li> </ul> <p> The thread is cached for use by subsequent async_resolve operations. This is by design. </p> Ticket