Boost C++ Libraries: Ticket #11119: mutex::unlock must not throw https://svn.boost.org/trac10/ticket/11119 <p> The Mutex requirements say </p> <pre class="wiki">m.unlock(); Requires: The current thread owns m. Synchronization: This operation synchronizes with subsequent lock operations that obtain ownership on the same object. Effects: Releases a lock on m by the current thread. Return type: void. Throws: Nothing. </pre><p> However mutex::unlock throws an exception. </p> <pre class="wiki">void unlock() { int res = posix::pthread_mutex_unlock(&amp;m); if (res) { boost::throw_exception(lock_error(res,"boost: mutex unlock failed in pthread_mutex_unlock")); } } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11119 Trac 1.4.3 viboes Sat, 14 Mar 2015 07:51:10 GMT owner, status, description changed https://svn.boost.org/trac10/ticket/11119#comment:1 https://svn.boost.org/trac10/ticket/11119#comment:1 <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>description</strong> modified (<a href="/trac10/ticket/11119?action=diff&amp;version=1">diff</a>) </li> </ul> Ticket viboes Sat, 04 Apr 2015 21:08:25 GMT summary changed https://svn.boost.org/trac10/ticket/11119#comment:2 https://svn.boost.org/trac10/ticket/11119#comment:2 <ul> <li><strong>summary</strong> <span class="trac-field-old">mutex::lock must not throw</span> → <span class="trac-field-new">mutex::unlock must not throw</span> </li> </ul> Ticket viboes Sat, 04 Apr 2015 21:32:15 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/11119#comment:3 https://svn.boost.org/trac10/ticket/11119#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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.58.0</span> </li> </ul> <pre class="wiki"> void unlock() { int res = posix::pthread_mutex_unlock(&amp;m); (void)res; BOOST_ASSERT(res == 0); // if (res) // { // boost::throw_exception(lock_error(res,"boost: mutex unlock failed in pthread_mutex_unlock")); // } } </pre> Ticket