Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86512 - in trunk: boost/interprocess boost/interprocess/sync/windows libs/interprocess/proj/vc7ide
From: igaztanaga_at_[hidden]
Date: 2013-10-29 04:05:28


Author: igaztanaga
Date: 2013-10-29 04:05:27 EDT (Tue, 29 Oct 2013)
New Revision: 86512
URL: http://svn.boost.org/trac/boost/changeset/86512

Log:
Fixes #9284 ("WaitForSingleObject(mutex) must handle WAIT_ABANDONED")

Text files modified:
   trunk/boost/interprocess/errors.hpp | 3 ++-
   trunk/boost/interprocess/sync/windows/winapi_wrapper_common.hpp | 13 ++++++++++---
   trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj | 6 ++++++
   3 files changed, 18 insertions(+), 4 deletions(-)

Modified: trunk/boost/interprocess/errors.hpp
==============================================================================
--- trunk/boost/interprocess/errors.hpp Tue Oct 29 03:39:21 2013 (r86511)
+++ trunk/boost/interprocess/errors.hpp 2013-10-29 04:05:27 EDT (Tue, 29 Oct 2013) (r86512)
@@ -114,7 +114,8 @@
    not_such_file_or_directory,
    invalid_argument,
    timeout_when_locking_error,
- timeout_when_waiting_error
+ timeout_when_waiting_error,
+ owner_dead_error
 };
 
 typedef int native_error_t;

Modified: trunk/boost/interprocess/sync/windows/winapi_wrapper_common.hpp
==============================================================================
--- trunk/boost/interprocess/sync/windows/winapi_wrapper_common.hpp Tue Oct 29 03:39:21 2013 (r86511)
+++ trunk/boost/interprocess/sync/windows/winapi_wrapper_common.hpp 2013-10-29 04:05:27 EDT (Tue, 29 Oct 2013) (r86512)
@@ -29,9 +29,16 @@
 
 inline void winapi_wrapper_wait_for_single_object(void *handle)
 {
- if(winapi::wait_for_single_object(handle, winapi::infinite_time) != winapi::wait_object_0){
- error_info err = system_error_code();
- throw interprocess_exception(err);
+ unsigned long ret = winapi::wait_for_single_object(handle, winapi::infinite_time);
+ if(ret != winapi::wait_object_0){
+ if(ret != winapi::wait_abandoned){
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
+ else{ //Special case for orphaned mutexes
+ winapi::release_mutex(handle);
+ throw interprocess_exception(owner_dead_error);
+ }
    }
 }
 

Modified: trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj
==============================================================================
--- trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj Tue Oct 29 03:39:21 2013 (r86511)
+++ trunk/libs/interprocess/proj/vc7ide/interprocesslib.vcproj 2013-10-29 04:05:27 EDT (Tue, 29 Oct 2013) (r86512)
@@ -356,6 +356,9 @@
                                 <File
                                         RelativePath="..\..\..\..\boost\interprocess\sync\windows\winapi_semaphore_wrapper.hpp">
                                 </File>
+ <File
+ RelativePath="..\..\..\..\boost\interprocess\sync\windows\winapi_wrapper_common.hpp">
+ </File>
                         </Filter>
                         <Filter
                                 Name="shm"
@@ -386,6 +389,9 @@
                                 Name="detail"
                                 Filter="">
                                 <File
+ RelativePath="..\..\..\..\boost\interprocess\sync\detail\common_algorithms.hpp">
+ </File>
+ <File
                                         RelativePath="..\..\..\..\boost\interprocess\sync\detail\condition_algorithm_8a.hpp">
                                 </File>
                                 <File


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk