Boost C++ Libraries: Ticket #7540: Add a helper class that join a thread on destruction https://svn.boost.org/trac10/ticket/7540 <p> Based on the thread_guard class defined in C++ Concurrency in Action define a helper class that join a thread on destruction. </p> <pre class="wiki"> // Based on the Anthony's idea of thread_guard in CCiA namespace boost { class thread_guard { thread&amp; t; public: BOOST_THREAD_NO_COPYABLE( thread_guard ) explicit thread_guard(thread&amp; t_) : t(t_) { } ~thread_guard() { if (t.joinable()) { t.join(); } } }; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7540 Trac 1.4.3 viboes Sun, 21 Oct 2012 10:34:39 GMT status changed https://svn.boost.org/trac10/ticket/7540#comment:1 https://svn.boost.org/trac10/ticket/7540#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Tue, 23 Oct 2012 16:09:17 GMT description changed https://svn.boost.org/trac10/ticket/7540#comment:2 https://svn.boost.org/trac10/ticket/7540#comment:2 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/7540?action=diff&amp;version=2">diff</a>) </li> </ul> Ticket viboes Tue, 23 Oct 2012 20:02:46 GMT description, summary changed https://svn.boost.org/trac10/ticket/7540#comment:3 https://svn.boost.org/trac10/ticket/7540#comment:3 <ul> <li><strong>description</strong> modified (<a href="/trac10/ticket/7540?action=diff&amp;version=3">diff</a>) </li> <li><strong>summary</strong> <span class="trac-field-old">Add a helper class that interrupts a thread and join it on destruction</span> → <span class="trac-field-new">Add a helper class that join a thread on destruction</span> </li> </ul> Ticket viboes Sun, 28 Oct 2012 17:56:27 GMT milestone deleted https://svn.boost.org/trac10/ticket/7540#comment:4 https://svn.boost.org/trac10/ticket/7540#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-deleted">To Be Determined</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/81074" title="Thread: Added thread_joiner">[81074]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/81079" title="Thread: update thread_guard to make it a template parameterized by ...">[81079]</a>. </p> Ticket viboes Sun, 02 Dec 2012 10:48:58 GMT <link>https://svn.boost.org/trac10/ticket/7540#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7540#comment:5</guid> <description> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/81667" title="Thread: merge from trunk 1.53">[81667]</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 08 Dec 2012 13:37:44 GMT</pubDate> <title>milestone set https://svn.boost.org/trac10/ticket/7540#comment:6 https://svn.boost.org/trac10/ticket/7540#comment:6 <ul> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.53.0</span> </li> </ul> Ticket viboes Sat, 08 Dec 2012 16:06:07 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7540#comment:7 https://svn.boost.org/trac10/ticket/7540#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket