Opened 5 years ago

Closed 5 years ago

#8924 closed Bugs (worksforme)

boost/thread/win32/basic_timed_mutex.hpp: Ignores failures from WaitForSingleObject

Reported by: Jeffrey Walton <noloader@…> Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.54.0 Severity: Problem
Keywords: synchronization WaitForSingleObject API failure Cc:

Description (last modified by viboes)

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.

Change History (5)

comment:1 Changed 5 years ago by viboes

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:2 Changed 5 years ago by viboes

What do you suggest?

comment:3 Changed 5 years ago by viboes

Description: modified (diff)

comment:4 Changed 5 years ago by viboes

See #8422 to understand when WAIT_ABANDONED was added. Reopen #8422 if you don't agree with the resolution.

comment:5 Changed 5 years ago by viboes

Resolution: worksforme
Status: assignedclosed

Please reopen it when you provide the requested informations.

Note: See TracTickets for help on using tickets.