Re: [Boost-bugs] [Boost C++ Libraries] #9284: WaitForSingleObject(mutex) must handle WAIT_ABANDONED

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9284: WaitForSingleObject(mutex) must handle WAIT_ABANDONED
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-30 09:35:44


#9284: WaitForSingleObject(mutex) must handle WAIT_ABANDONED
-------------------------------+--------------------------
  Reporter: huyuguang@… | Owner: igaztanaga
      Type: Bugs | Status: reopened
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.58.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------
Changes (by megaposer):

 * status: closed => reopened
 * version: Boost 1.54.0 => Boost 1.58.0
 * resolution: fixed =>

Comment:

 The fix is incomplete and should have been applied to all
 ''wait_for_single_object'' API wrapper methods in
 ''boost_1_58_0/boost/interprocess/sync/windows/winapi_wrapper_common.hpp'':

 {{{
 line 49 : inline bool winapi_wrapper_try_wait_for_single_object(void
 *handle) ...
 line 64 : inline bool winapi_wrapper_timed_wait_for_single_object(void
 *handle, const boost::posix_time::ptime &abs_time) ...
 }}}

 In both cases, the state ''WAIT_ABANDONED => winapi::wait_abandoned'' can
 occur and is not properly handled.

 That means the ''orphaned'' synchronization object will be acquired, but
 the code would throw an exception without previously releasing the
 synchronization object.

 Next time another thread tries to acquire the synchronization object, the
 object would still be locked. If the same thread tries to acquire the
 object, it would succeed, but the number of releases would not correctly
 offset the number of acquisitions.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9284#comment:6>
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