Boost C++ Libraries: Ticket #5829: condition.cpp: condition_impl::notify_all swallows errors from WaitForSingleObject https://svn.boost.org/trac10/ticket/5829 <p> condition_impl::notify_all silently swallows errors from <a class="missing wiki">WaitForSingleObject</a>. The author got the asserts correct, but took no action on failures. </p> <p> My apologies for throwing a runtime_error. I'm not familiar enogh with boost to know what should be thrown. I also suspect the code should throw earlier than before function exit. </p> <p> Index: condition.cpp =================================================================== RCS file: /cvsroot/boost/boost/libs/thread/src/condition.cpp,v retrieving revision 1.21 diff -<a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">r1</a>.21 condition.cpp 133,135c133,135 &lt; int res = 0; &lt; res = <a class="missing wiki">WaitForSingleObject</a>(reinterpret_cast&lt;HANDLE&gt;(m_mutex), INFINITE); &lt; assert(res == WAIT_OBJECT_0); --- </p> <blockquote class="citation"> <blockquote> <p> int wait1 = WAIT_OBJECT_0, wait2 = WAIT_OBJECT_0, res = 0; wait1 = <a class="missing wiki">WaitForSingleObject</a>(reinterpret_cast&lt;HANDLE&gt;(m_mutex), INFINITE); assert(wait1 == WAIT_OBJECT_0); </p> </blockquote> </blockquote> <p> 151,152c151,152 &lt; res = <a class="missing wiki">WaitForSingleObject</a>(reinterpret_cast&lt;HANDLE&gt;(m_gate), INFINITE); &lt; assert(res == WAIT_OBJECT_0); --- </p> <blockquote class="citation"> <blockquote> <p> wait2 = <a class="missing wiki">WaitForSingleObject</a>(reinterpret_cast&lt;HANDLE&gt;(m_gate), INFINITE); assert(wait2 == WAIT_OBJECT_0); </p> </blockquote> </blockquote> <p> 177a178,183 </p> <blockquote class="citation"> <blockquote> <p> if(wait1 != WAIT_OBJECT_0) </p> <blockquote> <p> throw std::runtime_error("Failed to wait on mutex"); </p> </blockquote> <p> if(wait2 != WAIT_OBJECT_0) </p> <blockquote> <p> throw std::runtime_error("Failed to wait on gate"); </p> </blockquote> </blockquote> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5829 Trac 1.4.3 Jeffrey Walton <noloader@…> Wed, 31 Aug 2011 00:37:51 GMT <link>https://svn.boost.org/trac10/ticket/5829#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5829#comment:1</guid> <description> <p> <code>assert(res == WAIT_OBJECT_0)</code> might be too tight - <code> assert(res == WAIT_OBJECT_0 || res == WAIT_ABANDONED_0)</code> might be a better choice. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sun, 16 Oct 2011 17:57:22 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/5829#comment:2 https://svn.boost.org/trac10/ticket/5829#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Anthony Williams</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> </ul> Ticket viboes Sat, 10 Dec 2011 15:12:54 GMT owner, status, type changed; cc set https://svn.boost.org/trac10/ticket/5829#comment:3 https://svn.boost.org/trac10/ticket/5829#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> <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> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Support Requests</span> </li> </ul> <p> Sorry, I don't see any file libs/thread/src/condition.cpp. Moved to support request until concerned file clarified. </p> Ticket viboes Thu, 29 Dec 2011 10:39:43 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5829#comment:4 https://svn.boost.org/trac10/ticket/5829#comment:4 <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> </ul> <p> Closed as it seems this doesn't corresponds to the current Boost.Thread implementation. </p> Ticket