Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86475 - trunk/boost/interprocess/sync/windows
From: igaztanaga_at_[hidden]
Date: 2013-10-27 08:16:43


Author: igaztanaga
Date: 2013-10-27 08:16:43 EDT (Sun, 27 Oct 2013)
New Revision: 86475
URL: http://svn.boost.org/trac/boost/changeset/86475

Log:
Fixes #9288

Text files modified:
   trunk/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp | 22 ++++++++++++++--------
   1 files changed, 14 insertions(+), 8 deletions(-)

Modified: trunk/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp
==============================================================================
--- trunk/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp Sun Oct 27 07:56:12 2013 (r86474)
+++ trunk/boost/interprocess/sync/windows/winapi_semaphore_wrapper.hpp 2013-10-27 08:16:43 EDT (Sun, 27 Oct 2013) (r86475)
@@ -79,17 +79,23 @@
          return true;
       }
 
- unsigned long ret = winapi::wait_for_single_object
- (m_sem_hnd, (abs_time - microsec_clock::universal_time()).total_milliseconds());
- if(ret == winapi::wait_object_0){
- return true;
- }
- else if(ret == winapi::wait_timeout){
+ boost::posix_time::ptime cur_time = microsec_clock::universal_time();
+ if(abs_time < cur_time){
          return false;
       }
       else{
- error_info err = system_error_code();
- throw interprocess_exception(err);
+ unsigned long ret = winapi::wait_for_single_object
+ (m_sem_hnd, (abs_time - cur_time).total_milliseconds());
+ if(ret == winapi::wait_object_0){
+ return true;
+ }
+ else if(ret == winapi::wait_timeout){
+ return false;
+ }
+ else{
+ error_info err = system_error_code();
+ throw interprocess_exception(err);
+ }
       }
    }
 


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