From f4fb2c1ab02a65b9f519f5759c81cc6c19a8d237 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Wed, 12 Jun 2013 20:54:44 +0000 Subject: [PATCH] Thread: merge fixes for #8422, #8458, #8674. [SVN r84750] --- include/boost/thread/detail/config.hpp | 5 +++++ include/boost/thread/detail/delete.hpp | 12 ++++++++++++ include/boost/thread/win32/basic_timed_mutex.hpp | 6 ++++-- include/boost/thread/win32/thread_primitives.hpp | 3 +++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/include/boost/thread/detail/config.hpp b/include/boost/thread/detail/config.hpp index 2d4b690b..ce5afc73 100644 --- a/include/boost/thread/detail/config.hpp +++ b/include/boost/thread/detail/config.hpp @@ -318,6 +318,11 @@ #define BOOST_THREAD_USES_DATETIME #endif +#if defined(BOOST_THREAD_PLATFORM_WIN32) && defined BOOST_THREAD_DONT_USE_CHRONO +#undef BOOST_THREAD_DONT_USE_CHRONO +#define BOOST_THREAD_USES_CHRONO +#endif + // BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55 // BOOST_THREAD_DONT_PROVIDE_DEPRECATED_FEATURES_SINCE_V3_0_0 defined by default up to Boost 1.55 #if defined BOOST_THREAD_PROVIDES_DEPRECATED_FEATURES_SINCE_V3_0_0 diff --git a/include/boost/thread/detail/delete.hpp b/include/boost/thread/detail/delete.hpp index 30e7c932..56fa1cdf 100644 --- a/include/boost/thread/detail/delete.hpp +++ b/include/boost/thread/detail/delete.hpp @@ -23,6 +23,17 @@ CLASS& operator=(CLASS const&) = delete; #else // BOOST_NO_CXX11_DELETED_FUNCTIONS +#if defined(BOOST_MSVC) +#define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ + private: \ + CLASS(CLASS const&); \ + public: + +#define BOOST_THREAD_DELETE_COPY_ASSIGN(CLASS) \ + private: \ + CLASS& operator=(CLASS const&); \ + public: +#else #define BOOST_THREAD_DELETE_COPY_CTOR(CLASS) \ private: \ CLASS(CLASS&); \ @@ -32,6 +43,7 @@ private: \ CLASS& operator=(CLASS&); \ public: +#endif #endif // BOOST_NO_CXX11_DELETED_FUNCTIONS /** diff --git a/include/boost/thread/win32/basic_timed_mutex.hpp b/include/boost/thread/win32/basic_timed_mutex.hpp index 73bbcc8d..01db0336 100644 --- a/include/boost/thread/win32/basic_timed_mutex.hpp +++ b/include/boost/thread/win32/basic_timed_mutex.hpp @@ -81,8 +81,10 @@ namespace boost do { - BOOST_VERIFY(win32::WaitForSingleObject( - sem,::boost::detail::win32::infinite)==0); + unsigned const retval(win32::WaitForSingleObject(sem, ::boost::detail::win32::infinite)); + BOOST_VERIFY(0 == retval || ::boost::detail::win32::wait_abandoned == retval); +// BOOST_VERIFY(win32::WaitForSingleObject( +// sem,::boost::detail::win32::infinite)==0); clear_waiting_and_try_lock(old_count); lock_acquired=!(old_count&lock_flag_value); } diff --git a/include/boost/thread/win32/thread_primitives.hpp b/include/boost/thread/win32/thread_primitives.hpp index c8497739..451d9c70 100644 --- a/include/boost/thread/win32/thread_primitives.hpp +++ b/include/boost/thread/win32/thread_primitives.hpp @@ -44,6 +44,8 @@ namespace boost handle const invalid_handle_value=INVALID_HANDLE_VALUE; unsigned const event_modify_state=EVENT_MODIFY_STATE; unsigned const synchronize=SYNCHRONIZE; + unsigned const wait_abandoned=WAIT_ABANDONED; + # ifdef BOOST_NO_ANSI_APIS using ::CreateMutexW; @@ -127,6 +129,7 @@ namespace boost handle const invalid_handle_value=(handle)(-1); unsigned const event_modify_state=2; unsigned const synchronize=0x100000u; + unsigned const wait_abandoned=0x00000080u; extern "C" {