Boost C++ Libraries: Ticket #5827: condition.cpp: condition_impl::notify_one swallows errors from WaitForSingleObject https://svn.boost.org/trac10/ticket/5827 <p> condition_impl::notify_one 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 81,83c81,83 &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> 100,101c100,101 &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> 126a127,132 </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> </blockquote> <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/5827 Trac 1.4.3 Jeffrey Walton <noloader@…> Wed, 31 Aug 2011 00:34:34 GMT component changed; owner set https://svn.boost.org/trac10/ticket/5827#comment:1 https://svn.boost.org/trac10/ticket/5827#comment:1 <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:11:08 GMT owner, status, type changed https://svn.boost.org/trac10/ticket/5827#comment:2 https://svn.boost.org/trac10/ticket/5827#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> <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:40:21 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5827#comment:3 https://svn.boost.org/trac10/ticket/5827#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">invalid</span> </li> </ul> <p> Closed as it seems this doesn't corresponds to the current Boost.Thread implementation. </p> Ticket