Boost C++ Libraries: Ticket #7464: BOOST_TEST(n_alive == 1); fails due to race condition in a regression test tool https://svn.boost.org/trac10/ticket/7464 <p> This problem is at least from boost_1_50_0 Using gcc-4.1.2, but it has nothing to do with the bug. Platform Linux. </p> <p> All libs/thread/test modules that test n_avail are having race condition which make cause regression test to fail here : </p> <pre class="wiki"> void operator()() { BOOST_TEST(alive_ == 1); BOOST_TEST(n_alive == 1); // race condition error op_run = true; } </pre><p> Rationale: </p> <p> When the G() object is being passed, copy constructor is used to copy the object. Then boost::detail::thread_data&lt;G&gt;::run() is executed and G::operator()() called. If this operator is called before the main thread calls ~G(), n_avail may be 2. It is a very rare case to have the new thread execute operator()() before the main thread, and that is why it is so difficult to catch it. </p> <p> Blessings, Greg. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7464 Trac 1.4.3 viboes Thu, 03 Jan 2013 18:47:32 GMT owner, status, component changed https://svn.boost.org/trac10/ticket/7464#comment:1 https://svn.boost.org/trac10/ticket/7464#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">René Rivera</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">Regression Testing</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket viboes Sat, 12 Jan 2013 09:59:15 GMT milestone changed https://svn.boost.org/trac10/ticket/7464#comment:2 https://svn.boost.org/trac10/ticket/7464#comment:2 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.53.0</span> </li> </ul> <p> Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/82455" title="Thread: comment not thread-safe check for the time been. atomic&lt;&gt; ...">[82455]</a> by viboes </p> Ticket viboes Mon, 14 Jan 2013 17:22:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7464#comment:3 https://svn.boost.org/trac10/ticket/7464#comment:3 <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> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/82491" title="Thread: merge 82459,82457,82456,82455">[82491]</a>. </p> Ticket