Subject: Re: [Boost-bugs] [Boost C++ Libraries] #8422: Assertion in win32::WaitForSingleObject()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-22 11:18:02
#8422: Assertion in win32::WaitForSingleObject()
-------------------------------------+--------------------------------------
Reporter: robert.stewart@⦠| Owner: viboes
Type: Bugs | Status: assigned
Milestone: To Be Determined | Component: thread
Version: Boost 1.53.0 | Severity: Problem
Resolution: | Keywords: assertion basic_timed_mutex win32 WaitForSingleObject
-------------------------------------+--------------------------------------
Comment (by robert.stewart@â¦):
Since that return value means the calling thread owns the mutex by default
of the previous owner, it should be treated as equivalent to
`WAIT_OBJECT0`. Thus, the following seems appropriate:
{{{#!cpp
DWORD const retval(win32::WaitForSingleObject(sem,
::boost::detail::win32::infinite));
BOOST_VERIFY(WAIT_OBJECT0 == retval || WAIT_ABANDONED == retval);
}}}
You might prefer to repackage `WAIT_ABANDONED` like `WAIT_TIMEOUT` is, so
the following may be more in keeping with the current code:
{{{#!cpp
DWORD const retval(win32::WaitForSingleObject(sem,
::boost::detail::win32::infinite));
BOOST_VERIFY(0 == retval || ::boost::detail::win32::abandoned == retval);
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8422#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:13 UTC