Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11119: mutex::lock must not throw
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-14 07:51:10
#11119: mutex::lock must not throw
-------------------------------+----------------------
Reporter: viboes | Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+----------------------
Changes (by viboes):
* owner: anthonyw => viboes
* status: new => assigned
Old description:
> The Mutex requirements say
>
> {{{
> 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.
> }}}
>
> However mutex::unlock throws an exception.
New description:
The Mutex requirements say
{{{
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.
}}}
However mutex::unlock throws an exception.
{{{
void unlock()
{
int res = posix::pthread_mutex_unlock(&m);
if (res)
{
boost::throw_exception(lock_error(res,"boost: mutex unlock failed
in pthread_mutex_unlock"));
}
}
}}}
-- -- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11119#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC