Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8924: boost/thread/win32/basic_timed_mutex.hpp: Ignores failures from WaitForSingleObject
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-09-01 07:37:36
#8924: boost/thread/win32/basic_timed_mutex.hpp: Ignores failures from
WaitForSingleObject
-------------------------------------+-------------------------------------
Reporter: Jeffrey Walton | Owner: viboes
<noloader@â¦> | Status: assigned
Type: Bugs | Component: thread
Milestone: To Be Determined | Severity: Problem
Version: Boost 1.54.0 | Keywords: synchronization
Resolution: | WaitForSingleObject API failure
-------------------------------------+-------------------------------------
Description changed by viboes:
Old description:
> boost/thread/win32/basic_timed_mutex.hpp ignores failures from
> WaitForSingleObject. There's not much point in looping if its just going
> to fail again:
>
> do
> {
> unsigned const retval(win32::WaitForSingleObject(sem,
> ::boost::detail::win32::infinite));
> BOOST_VERIFY(0 == retval || ::boost::detail::win32::wait_abandoned ==
> retval);
> clear_waiting_and_try_lock(old_count);
> lock_acquired=!(old_count&lock_flag_value);
> }
> while(!lock_acquired);
>
> The use of BOOST_VERIFY is good, but I'm not sure about the
> WAIT_ABANDONED. WAIT_ABANDONED usually indicates a bigger problem, and
> continuing might not be a good idea.
New description:
boost/thread/win32/basic_timed_mutex.hpp ignores failures from
WaitForSingleObject. There's not much point in looping if its just going
to fail again:
{{{
do
{
unsigned const retval(win32::WaitForSingleObject(sem,
::boost::detail::win32::infinite));
BOOST_VERIFY(0 == retval || ::boost::detail::win32::wait_abandoned ==
retval);
clear_waiting_and_try_lock(old_count);
lock_acquired=!(old_count&lock_flag_value);
}
while(!lock_acquired);
}}}
The use of BOOST_VERIFY is good, but I'm not sure about the
WAIT_ABANDONED. WAIT_ABANDONED usually indicates a bigger problem, and
continuing might not be a good idea.
-- -- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8924#comment:3> 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:14 UTC