/usr/include/boost/interprocess/sync/windows
NameSizeModeActions
condition.hpp37130644editdlrm
mutex.hpp33570644editdlrm
named_condition.hpp11560644editdlrm
named_condition_any.hpp78360644editdlrm
named_mutex.hpp49750644editdlrm
named_recursive_mutex.hpp20250644editdlrm
named_semaphore.hpp53860644editdlrm
named_sync.hpp83140644editdlrm
recursive_mutex.hpp13940644editdlrm
semaphore.hpp35710644editdlrm
sync_utils.hpp71070644editdlrm
winapi_mutex_wrapper.hpp37170644editdlrm
winapi_semaphore_wrapper.hpp46910644editdlrm
winapi_wrapper_common.hpp26460644editdlrm
Edit: /usr/include/boost/interprocess/sync/windows/winapi_wrapper_common.hpp (2646B)
////////////////////////////////////////////////////////////////////////////// // // (C) Copyright Ion Gaztanaga 2011-2012. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // See http://www.boost.org/libs/interprocess for documentation. // ////////////////////////////////////////////////////////////////////////////// #ifndef BOOST_INTERPROCESS_DETAIL_WINAPI_WRAPPER_COMMON_HPP #define BOOST_INTERPROCESS_DETAIL_WINAPI_WRAPPER_COMMON_HPP #ifndef BOOST_CONFIG_HPP # include #endif # #if defined(BOOST_HAS_PRAGMA_ONCE) # pragma once #endif #include #include #include #include #include #include #include namespace boost { namespace interprocess { namespace ipcdetail { inline bool do_winapi_wait(void *handle, unsigned long dwMilliseconds) { unsigned long ret = winapi::wait_for_single_object(handle, dwMilliseconds); if(ret == winapi::wait_object_0){ return true; } else if(ret == winapi::wait_timeout){ return false; } else if(ret == winapi::wait_abandoned){ //Special case for orphaned mutexes winapi::release_mutex(handle); throw interprocess_exception(owner_dead_error); } else{ error_info err = system_error_code(); throw interprocess_exception(err); } } inline bool winapi_wrapper_timed_wait_for_single_object(void *handle, const boost::posix_time::ptime &abs_time) { //Windows uses relative wait times so check for negative waits //and implement as 0 wait to allow try-semantics as POSIX mandates. unsigned long time = 0u; if (abs_time.is_pos_infinity()){ time = winapi::infinite_time; } else { const boost::posix_time::ptime cur_time = microsec_clock::universal_time(); if(abs_time > cur_time){ time = (abs_time - cur_time).total_milliseconds(); } } return do_winapi_wait(handle, time); } inline void winapi_wrapper_wait_for_single_object(void *handle) { (void)do_winapi_wait(handle, winapi::infinite_time); } inline bool winapi_wrapper_try_wait_for_single_object(void *handle) { return do_winapi_wait(handle, 0u); } } //namespace ipcdetail { } //namespace interprocess { } //namespace boost { #include #endif //BOOST_INTERPROCESS_DETAIL_WINAPI_WRAPPER_COMMON_HPP