Boost C++ Libraries: Ticket #10237: [windows] condition_variable wait infinitly https://svn.boost.org/trac10/ticket/10237 <p> Os:any windows </p> <p> The app will wait infinitly when app code like below: </p> <p> <em>thread A </em></p> <pre class="wiki">cout&lt;&lt;"Start to wait B..."&lt;&lt;endl; con.wait(lock); cout&lt;&lt;"Run A..."&lt;&lt;endl; boost::this_thread::sleep(boost::posix_time::seconds(1));//do something cout&lt;&lt;"Start to notify B..."&lt;&lt;endl; con.notify_one(); cout&lt;&lt;"End to notify B..."&lt;&lt;endl; </pre><p> <em>thread B </em></p> <pre class="wiki">boost::this_thread::sleep(boost::posix_time::seconds(2));//do something con.notify_one(); boost::this_thread::sleep(boost::posix_time::seconds(2)); cout&lt;&lt;"Start to wait A..."&lt;&lt;endl; con.wait(lock);//thread A will call notify_one before this line cout&lt;&lt;"Run again A..."&lt;&lt;endl; </pre><p> cause:\boost\thread\win32\condition_variable.hpp line 261 </p> <pre class="wiki">if(detail::interlocked_read_acquire(&amp;total_count)) </pre><p> The code will get read acquire count,and skip release when read acquire count is zero </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10237 Trac 1.4.3 anonymous Thu, 24 Jul 2014 05:33:06 GMT summary changed https://svn.boost.org/trac10/ticket/10237#comment:1 https://svn.boost.org/trac10/ticket/10237#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">condition_variable</span> → <span class="trac-field-new">condition_variable wait infinitly</span> </li> </ul> Ticket viboes Sat, 02 Aug 2014 15:03:30 GMT owner, status changed https://svn.boost.org/trac10/ticket/10237#comment:2 https://svn.boost.org/trac10/ticket/10237#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</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> </ul> Ticket viboes Mon, 25 Aug 2014 00:15:07 GMT summary changed https://svn.boost.org/trac10/ticket/10237#comment:3 https://svn.boost.org/trac10/ticket/10237#comment:3 <ul> <li><strong>summary</strong> <span class="trac-field-old">condition_variable wait infinitly</span> → <span class="trac-field-new">[windows] condition_variable wait infinitly</span> </li> </ul> Ticket viboes Sun, 14 Sep 2014 17:11:42 GMT <link>https://svn.boost.org/trac10/ticket/10237#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10237#comment:4</guid> <description> <p> The current implementation of interlocked_read_acquire uses <a class="missing wiki">InterlockedCompareExchange</a>. </p> <p> I don't know well the windows interface, but why do you think that need to release? Have you a working example that fall in the race condition you expose? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 23 Sep 2014 00:16:42 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/10237#comment:5 https://svn.boost.org/trac10/ticket/10237#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> Ticket viboes Tue, 23 Sep 2014 00:23:50 GMT status changed; resolution set; milestone deleted https://svn.boost.org/trac10/ticket/10237#comment:6 https://svn.boost.org/trac10/ticket/10237#comment:6 <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">invalid</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.57.0</span> </li> </ul> <p> Please reopen it when you have a test case or a deeper analysis. </p> Ticket