From 23e7135f2c5f81b0192700a2c5de82599916d3c5 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 29 Jul 2017 17:06:24 +0300 Subject: [PATCH 01/15] Use BOOST_MAY_ALIAS from Boost.Config. --- include/boost/thread/detail/config.hpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/include/boost/thread/detail/config.hpp b/include/boost/thread/detail/config.hpp index 9eff05f5..6a90c1a8 100644 --- a/include/boost/thread/detail/config.hpp +++ b/include/boost/thread/detail/config.hpp @@ -17,16 +17,14 @@ //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS // ATTRIBUTE_MAY_ALIAS -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if !defined(BOOST_NO_MAY_ALIAS) - // GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with - // regard to violation of the strict aliasing rules. + // GCC since 3.3 and some other compilers have may_alias attribute that helps + // to alleviate optimizer issues with regard to violation of the strict aliasing rules. #define BOOST_THREAD_DETAIL_USE_ATTRIBUTE_MAY_ALIAS - #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) -#else - #define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS #endif +#define BOOST_THREAD_ATTRIBUTE_MAY_ALIAS BOOST_MAY_ALIAS #if defined BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED From 047205fbbd488fb83cc7a96d22337ef9e45dbc42 Mon Sep 17 00:00:00 2001 From: David Olsen Date: Wed, 2 Aug 2017 15:19:32 -0700 Subject: [PATCH 02/15] Fix sleep_until() to use a realtime clock boost::this_thread::no_interruption_point::hidden::sleep_until() takes an absolute time as a parameter and converts it to a duration for the length of time to sleep. But the current time that the absolute time is compared against came from timespec_now(), which, on Linux at least, uses CLOCK_MONOTONIC, which "represents monotonic time since some unspecified starting point." Since timespec_now() may have a different starting point than the time that was passed to sleep_until(), that can result in sleep_until() sleeping for an *extremely* long time, causing the program to appear to hang. Change sleep_until() to get the current time from timespec_now_realtime(), which uses CLOCK_REALTIME, which has the same epoch as the time that is passed to sleep_until(). --- src/pthread/thread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 12c3cf96..cd4b3ea1 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -459,7 +459,7 @@ namespace boost void BOOST_THREAD_DECL sleep_until(const timespec& ts) { - timespec now = boost::detail::timespec_now(); + timespec now = boost::detail::timespec_now_realtime(); if (boost::detail::timespec_gt(ts, now)) { for (int foo=0; foo < 5; ++foo) @@ -479,7 +479,7 @@ namespace boost condition_variable cond; cond.do_wait_until(lock, ts); # endif - timespec now2 = boost::detail::timespec_now(); + timespec now2 = boost::detail::timespec_now_realtime(); if (boost::detail::timespec_ge(now2, ts)) { return; From 24a22b66ef729a645788f13e5127044f867478bc Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sun, 13 Aug 2017 07:19:42 +0200 Subject: [PATCH 03/15] Workaround deprecated ::getpagesize(). --- include/boost/thread/pthread/thread_data.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index 836e6927..cbbf1e42 100644 --- a/include/boost/thread/pthread/thread_data.hpp +++ b/include/boost/thread/pthread/thread_data.hpp @@ -50,7 +50,11 @@ namespace boost // stack void set_stack_size(std::size_t size) BOOST_NOEXCEPT { if (size==0) return; +#ifdef BOOST_THREAD_USES_GETPAGESIZE std::size_t page_size = getpagesize(); +#else + std::size_t page_size = ::sysconf( _SC_PAGESIZE); +#endif #ifdef PTHREAD_STACK_MIN if (size Date: Tue, 15 Aug 2017 07:29:10 +0900 Subject: [PATCH 04/15] Do not include same header twice include/boost/thread/pthread/shared_mutex.hpp --- include/boost/thread/pthread/shared_mutex.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/boost/thread/pthread/shared_mutex.hpp b/include/boost/thread/pthread/shared_mutex.hpp index b427b0f1..e4ec24fe 100644 --- a/include/boost/thread/pthread/shared_mutex.hpp +++ b/include/boost/thread/pthread/shared_mutex.hpp @@ -20,7 +20,6 @@ #include #endif #include -#include #include From 28bf345c963864565fdf0f3e315600c585a89217 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Wed, 16 Aug 2017 20:30:59 +0200 Subject: [PATCH 05/15] make more evident that timespec is realtime and not monotonic. --- include/boost/thread/detail/config.hpp | 2 +- include/boost/thread/detail/thread.hpp | 2 +- .../thread/pthread/condition_variable_fwd.hpp | 12 ++---------- include/boost/thread/pthread/thread_data.hpp | 6 +++--- include/boost/thread/pthread/timespec.hpp | 19 ++++--------------- src/pthread/thread.cpp | 7 +++---- 6 files changed, 14 insertions(+), 34 deletions(-) diff --git a/include/boost/thread/detail/config.hpp b/include/boost/thread/detail/config.hpp index 6a90c1a8..2987de66 100644 --- a/include/boost/thread/detail/config.hpp +++ b/include/boost/thread/detail/config.hpp @@ -12,11 +12,11 @@ #include #include -#define BOOST_THREAD_USEFIXES_TIMESPEC //#define BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC //#define BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS // ATTRIBUTE_MAY_ALIAS +//#if defined(__GNUC__) && !defined(__INTEL_COMPILER) #if !defined(BOOST_NO_MAY_ALIAS) // GCC since 3.3 and some other compilers have may_alias attribute that helps diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 6424e483..6790be6e 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -157,7 +157,7 @@ namespace boost } namespace thread_detail { #ifdef BOOST_THREAD_USES_CHRONO -#if defined(BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC) && defined(BOOST_THREAD_USEFIXES_TIMESPEC) +#if defined(BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC) typedef chrono::steady_clock internal_clock_t; #else typedef chrono::system_clock internal_clock_t; diff --git a/include/boost/thread/pthread/condition_variable_fwd.hpp b/include/boost/thread/pthread/condition_variable_fwd.hpp index 802a5cc6..4d113e7e 100644 --- a/include/boost/thread/pthread/condition_variable_fwd.hpp +++ b/include/boost/thread/pthread/condition_variable_fwd.hpp @@ -69,16 +69,8 @@ namespace boost unique_lock& lock, struct timespec const &timeout) { -#if ! defined BOOST_THREAD_USEFIXES_TIMESPEC - return do_wait_until(lock, boost::detail::timespec_plus(timeout, boost::detail::timespec_now())); -#elif ! defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC - //using namespace chrono; - //nanoseconds ns = chrono::system_clock::now().time_since_epoch(); - - struct timespec ts = boost::detail::timespec_now_realtime(); - //ts.tv_sec = static_cast(chrono::duration_cast(ns).count()); - //ts.tv_nsec = static_cast((ns - chrono::duration_cast(ns)).count()); - return do_wait_until(lock, boost::detail::timespec_plus(timeout, ts)); +#if defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC + return do_wait_until(lock, boost::detail::timespec_plus(timeout, boost::detail::timespec_now_monotonic())); #else // old behavior was fine for monotonic return do_wait_until(lock, boost::detail::timespec_plus(timeout, boost::detail::timespec_now_realtime())); diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index cbbf1e42..cb15b99d 100644 --- a/include/boost/thread/pthread/thread_data.hpp +++ b/include/boost/thread/pthread/thread_data.hpp @@ -244,7 +244,7 @@ namespace boost namespace hidden { void BOOST_THREAD_DECL sleep_for(const timespec& ts); - void BOOST_THREAD_DECL sleep_until(const timespec& ts); + void BOOST_THREAD_DECL sleep_until_realtime(const timespec& ts); } #ifdef BOOST_THREAD_USES_CHRONO @@ -263,7 +263,7 @@ namespace boost namespace hidden { void BOOST_THREAD_DECL sleep_for(const timespec& ts); - void BOOST_THREAD_DECL sleep_until(const timespec& ts); + void BOOST_THREAD_DECL sleep_until_realtime(const timespec& ts); } #ifdef BOOST_THREAD_USES_CHRONO @@ -288,7 +288,7 @@ namespace boost #endif inline void sleep(system_time const& abs_time) { - return boost::this_thread::hidden::sleep_until(boost::detail::to_timespec(abs_time)); + return boost::this_thread::hidden::sleep_until_realtime(boost::detail::to_timespec(abs_time)); } template diff --git a/include/boost/thread/pthread/timespec.hpp b/include/boost/thread/pthread/timespec.hpp index 74583ed0..1fb8de94 100644 --- a/include/boost/thread/pthread/timespec.hpp +++ b/include/boost/thread/pthread/timespec.hpp @@ -71,32 +71,21 @@ namespace boost { return (ts.tv_sec >= 0) || (ts.tv_nsec >= 0); } - inline timespec timespec_now() +#if defined BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC + + inline timespec timespec_now_monotonic() { timespec ts; -#if defined CLOCK_MONOTONIC && defined BOOST_THREAD_USEFIXES_TIMESPEC if ( ::clock_gettime( CLOCK_MONOTONIC, &ts ) ) { ts.tv_sec = 0; ts.tv_nsec = 0; BOOST_ASSERT(0 && "Boost::Thread - Internal Error"); } -#elif defined(BOOST_THREAD_TIMESPEC_MAC_API) - timeval tv; - ::gettimeofday(&tv, 0); - ts.tv_sec = tv.tv_sec; - ts.tv_nsec = tv.tv_usec * 1000; -#else - if ( ::clock_gettime( CLOCK_REALTIME, &ts ) ) - { - ts.tv_sec = 0; - ts.tv_nsec = 0; - BOOST_ASSERT(0 && "Boost::Thread - Internal Error"); - } -#endif return ts; } +#endif inline timespec timespec_now_realtime() { diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index cd4b3ea1..6b7da8c8 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -457,7 +457,7 @@ namespace boost } } - void BOOST_THREAD_DECL sleep_until(const timespec& ts) + void BOOST_THREAD_DECL sleep_until_realtime(const timespec& ts) { timespec now = boost::detail::timespec_now_realtime(); if (boost::detail::timespec_gt(ts, now)) @@ -487,7 +487,6 @@ namespace boost } } } - } } namespace hidden @@ -507,7 +506,7 @@ namespace boost } } - void BOOST_THREAD_DECL sleep_until(const timespec& ts) + void BOOST_THREAD_DECL sleep_until_realtime(const timespec& ts) { boost::detail::thread_data_base* const thread_info=boost::detail::get_current_thread_data(); @@ -518,7 +517,7 @@ namespace boost } else { - boost::this_thread::no_interruption_point::hidden::sleep_until(ts); + boost::this_thread::no_interruption_point::hidden::sleep_until_realtime(ts); } } } // hidden From bb32aa3164c89bf882c248ff7794661f88d17768 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Tue, 22 Aug 2017 23:48:23 +0200 Subject: [PATCH 06/15] manage with 13163-boost::detail::heap_new does not have a variadic variant. --- include/boost/thread/detail/thread.hpp | 2 +- .../thread/pthread/thread_heap_alloc.hpp | 34 +++++- .../boost/thread/win32/thread_heap_alloc.hpp | 100 +++++++++++++++++- 3 files changed, 132 insertions(+), 4 deletions(-) diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 6790be6e..b91adee0 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -299,7 +299,7 @@ namespace thread_detail { template explicit thread(F f , typename disable_if_c< - boost::thread_detail::is_rv::value // todo ass a thread_detail::is_rv + boost::thread_detail::is_rv::value // todo as a thread_detail::is_rv //boost::thread_detail::is_convertible::value //|| is_same::type, thread>::value , dummy* >::type=0 diff --git a/include/boost/thread/pthread/thread_heap_alloc.hpp b/include/boost/thread/pthread/thread_heap_alloc.hpp index 7828318f..dec7b661 100644 --- a/include/boost/thread/pthread/thread_heap_alloc.hpp +++ b/include/boost/thread/pthread/thread_heap_alloc.hpp @@ -16,8 +16,13 @@ namespace boost { return new T(); } - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) && ! defined (BOOST_NO_CXX11_RVALUE_REFERENCES) + template + inline T* heap_new(Args&&... args) + { + return new T(static_cast(args)...); + } +#elif ! defined BOOST_NO_CXX11_RVALUE_REFERENCES template inline T* heap_new(A1&& a1) { @@ -61,6 +66,31 @@ namespace boost { return new T(a1,a2,a3,a4); } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) + { + return new T(a1,a2,a3,a4,a5); + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6) + { + return new T(a1,a2,a3,a4,a5,a6); + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7) + { + return new T(a1,a2,a3,a4,a5,a6,a7); + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8) + { + return new T(a1,a2,a3,a4,a5,a6,a7,a8); + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9) + { + return new T(a1,a2,a3,a4,a5,a6,a7,a8,a9); + } template inline T* heap_new(A1 const& a1) diff --git a/include/boost/thread/win32/thread_heap_alloc.hpp b/include/boost/thread/win32/thread_heap_alloc.hpp index 610fe326..8333fc7d 100644 --- a/include/boost/thread/win32/thread_heap_alloc.hpp +++ b/include/boost/thread/win32/thread_heap_alloc.hpp @@ -72,7 +72,24 @@ namespace boost { BOOST_VERIFY(detail::win32::HeapFree(detail::win32::GetProcessHeap(),0,heap_memory)!=0); } - +#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD) && ! defined (BOOST_NO_CXX11_RVALUE_REFERENCES) + template + inline T* heap_new(Args&&... args) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(static_cast(args)...); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } +#else template inline T* heap_new() { @@ -225,6 +242,86 @@ namespace boost } BOOST_CATCH_END } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(a1,a2,a3,a4,a5); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(a1,a2,a3,a4,a5,a6); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(a1,a2,a3,a4,a5,a6,a7); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(a1,a2,a3,a4,a5,a6,a7,a8); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } + template + inline T* heap_new_impl(A1 a1,A2 a2,A3 a3,A4 a4,A5 a5,A6 a6,A7 a7,A8 a8,A9 a9) + { + void* const heap_memory=allocate_raw_heap_memory(sizeof(T)); + BOOST_TRY + { + T* const data=new (heap_memory) T(a1,a2,a3,a4,a5,a6,a7,a8,a9); + return data; + } + BOOST_CATCH(...) + { + free_raw_heap_memory(heap_memory); + BOOST_RETHROW + } + BOOST_CATCH_END + } template @@ -384,6 +481,7 @@ namespace boost return heap_new_impl(a1,a2,a3,a4); } +#endif #endif template inline void heap_delete(T* data) From f27a2921daae9ffc681054109ecff604ecf63cc4 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Wed, 23 Aug 2017 00:33:57 +0200 Subject: [PATCH 07/15] manage with #13019 - ABI compatibility for BOOST_THREAD_PROVIDES_INTERRUPTIONS incomplete. --- .../thread/pthread/condition_variable_fwd.hpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/include/boost/thread/pthread/condition_variable_fwd.hpp b/include/boost/thread/pthread/condition_variable_fwd.hpp index 4d113e7e..0ea34e23 100644 --- a/include/boost/thread/pthread/condition_variable_fwd.hpp +++ b/include/boost/thread/pthread/condition_variable_fwd.hpp @@ -53,9 +53,9 @@ namespace boost class condition_variable { private: -#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS +//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS pthread_mutex_t internal_mutex; -#endif +//#endif pthread_cond_t cond; public: @@ -82,31 +82,37 @@ namespace boost condition_variable() { int res; -#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS +//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS + // Even if it is not used, the internal_mutex exists (see + // above) and must be initialized (etc) in case some + // compilation units provide interruptions and others + // don't. res=pthread_mutex_init(&internal_mutex,NULL); if(res) { boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in pthread_mutex_init")); } -#endif +//#endif res = detail::monotonic_pthread_cond_init(cond); if (res) { -#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS +//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS + // ditto BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex)); -#endif +//#endif boost::throw_exception(thread_resource_error(res, "boost::condition_variable::condition_variable() constructor failed in detail::monotonic_pthread_cond_init")); } } ~condition_variable() { int ret; -#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS +//#if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS + // ditto do { ret = pthread_mutex_destroy(&internal_mutex); } while (ret == EINTR); BOOST_ASSERT(!ret); -#endif +//#endif do { ret = pthread_cond_destroy(&cond); } while (ret == EINTR); From fdc0cbcd8ce8f34a19c7cdaf6f1fa679f0a49657 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Thu, 24 Aug 2017 08:45:36 +0200 Subject: [PATCH 08/15] #130 - Bug in boost::condition_variable on Windows. --- include/boost/thread/win32/condition_variable.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index f4b535f7..9c2bf839 100644 --- a/include/boost/thread/win32/condition_variable.hpp +++ b/include/boost/thread/win32/condition_variable.hpp @@ -211,7 +211,7 @@ namespace boost {} #endif - void remove_waiter() + void remove_waiter_and_reset() { if (entry) { boost::lock_guard internal_lock(internal_mutex); @@ -250,7 +250,7 @@ namespace boost woken=entry->woken(); } // do it here to avoid throwing on the destructor - entry->remove_waiter(); + entry.remove_waiter_and_reset(); locker.lock(); return woken; } From 395e3d786bc1dce9c60eb84da85f5845a2c1fb3d Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Thu, 24 Aug 2017 09:04:26 +0200 Subject: [PATCH 09/15] #130 - Bug in boost::condition_variable on Windows. --- include/boost/thread/win32/condition_variable.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/thread/win32/condition_variable.hpp b/include/boost/thread/win32/condition_variable.hpp index 9c2bf839..7f670bb9 100644 --- a/include/boost/thread/win32/condition_variable.hpp +++ b/include/boost/thread/win32/condition_variable.hpp @@ -221,7 +221,7 @@ namespace boost } ~entry_manager() BOOST_NOEXCEPT_IF(false) { - remove_waiter(); + remove_waiter_and_reset(); } list_entry* operator->() From 19c590a88189e16a1ac4ce861ca437d65f465717 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:38:37 +0200 Subject: [PATCH 10/15] manage with #12949. --- include/boost/thread/pthread/thread_data.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index cb15b99d..41563ebc 100644 --- a/include/boost/thread/pthread/thread_data.hpp +++ b/include/boost/thread/pthread/thread_data.hpp @@ -248,6 +248,8 @@ namespace boost } #ifdef BOOST_THREAD_USES_CHRONO + template + void sleep_for(const chrono::duration& d); #ifdef BOOST_THREAD_SLEEP_FOR_IS_STEADY inline @@ -267,6 +269,8 @@ namespace boost } #ifdef BOOST_THREAD_USES_CHRONO + template + void sleep_for(const chrono::duration& d); #ifdef BOOST_THREAD_SLEEP_FOR_IS_STEADY inline From 510e66aef73ace89beec20c8928540648d14a7a3 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:39:31 +0200 Subject: [PATCH 11/15] rename make_ready to notify_deferred. --- include/boost/thread/future.hpp | 2 +- src/pthread/thread.cpp | 2 +- src/win32/thread.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/thread/future.hpp b/include/boost/thread/future.hpp index 7e113e9d..71c4b640 100644 --- a/include/boost/thread/future.hpp +++ b/include/boost/thread/future.hpp @@ -299,7 +299,7 @@ namespace boost } do_continuation(lock); } - void make_ready() + void notify_deferred() { boost::unique_lock lock(this->mutex); mark_finished_internal(lock); diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 6b7da8c8..5e51f8ea 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -52,7 +52,7 @@ namespace boost for (async_states_t::iterator i = async_states_.begin(), e = async_states_.end(); i != e; ++i) { - (*i)->make_ready(); + (*i)->notify_deferred(); } } diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 7e2c21bc..988ee416 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -57,7 +57,7 @@ namespace boost for (async_states_t::iterator i = async_states_.begin(), e = async_states_.end(); i != e; ++i) { - (*i)->make_ready(); + (*i)->notify_deferred(); } } } From 738ab1957315e4920ed978cf0d9d893d29b88793 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:41:58 +0200 Subject: [PATCH 12/15] Update to new version 4.8.0with changes. --- doc/changes.qbk | 43 ++++++++++++++++++++++++++++++++++++++++++- doc/thread.qbk | 2 +- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/doc/changes.qbk b/doc/changes.qbk index 31ea573c..467bd8eb 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -8,6 +8,47 @@ [section:changes History] +[heading Version 4.8.0 - boost 1.66] + +[*Know Bugs:] + +* [@http://svn.boost.org/trac/boost/ticket/3926 #3926] thread_specific_ptr + dlopen library causes a SIGSEGV. + +* [@http://svn.boost.org/trac/boost/ticket/10964 #10964] future>::unwrap().then() Deadlocks + + +Please take a look at [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=thread&type=!Feature+Requests&col=id&col=summary&order=id thread Know Bugs] to see the current state. + +Please take a look at [@http://www.boost.org/development/tests/master/developer/thread.html thread master regression test] to see the last regression test snapshot. + +[*Fixed Bugs:] + +* [@http://svn.boost.org/trac/boost/ticket/12949 #12949] using sleep_for in a thread context without including boost/thread/thread.hpp yields incorrect behaviour when BOOST_THREAD_HAS_CONDATTR_SET_CLOCK_MONOTONIC is defined +* [@http://svn.boost.org/trac/boost/ticket/13019 #13019] ABI compatibility for BOOST_THREAD_PROVIDES_INTERRUPTIONS incomplete +* [@http://svn.boost.org/trac/boost/ticket/13163 #13163] boost::detail::heap_new does not have a variadic variant + +[heading Version 4.7.4 - boost 1.65] + +[*Fixed Bugs:] + +* [@http://svn.boost.org/trac/boost/ticket/6787 #6787] boost::thread::sleep() hangs if system time is rolled back +* [@http://svn.boost.org/trac/boost/ticket/12519 #12519] boost::thread::try_join_for does not return after timeout +* [@http://svn.boost.org/trac/boost/ticket/12874 #12874] future<> extension constructor must be under BOOST_THREAD_PROVIDES_FUTURE_UNWRAP +* [@http://svn.boost.org/trac/boost/ticket/12888 #12888] Linking with boost thread does not work on mingw/gcc 4.4 +* [@http://svn.boost.org/trac/boost/ticket/12958 #12958] sync_bounded_queue::wait_pull_front( lve ) might throw +* [@http://svn.boost.org/trac/boost/ticket/13077 #13077] Linking to static 64bit libboost_thread fails DLL initialization +* [@http://svn.boost.org/trac/boost/ticket/13155 #13155] log doesn't build on a system with pthreads + +* [@https://github.com/boostorg/thread/issues/121 #121] on_tls_prepare is broken under VS2017 + +[heading Version 4.7.3 - boost 1.64] + +[*Fixed Bugs:] + +* [@https://github.com/boostorg/thread/issues/113 #113] Add a Thread template on all the scoped thread and thread guard classes +* [@https://github.com/boostorg/thread/issues/117 #117] loop_executor should block on it's work_queue instead of polling +* [@https://github.com/boostorg/thread/issues/119 #119] basic_condition_variable::relocker::~relocker can throw an exception + [heading Version 4.7.2 - boost 1.63] [*Fixed Bugs:] @@ -27,7 +68,7 @@ Please define BOOST_THREAD_PATCH to apply the patch that could unfortunately res Please take a look at [@https://svn.boost.org/trac/boost/query?status=assigned&status=new&status=reopened&component=thread&type=!Feature+Requests&col=id&col=summary&order=id thread Know Bugs] to see the current state. -Please take a look at [@http://www.boost.org/development/tests/master/developer/thread.html thread trunk regression test] to see the last regression test snapshot. +Please take a look at [@http://www.boost.org/development/tests/master/developer/thread.html thread master regression test] to see the last regression test snapshot. [*Fixed Bugs:] diff --git a/doc/thread.qbk b/doc/thread.qbk index b49d75e6..65a95e77 100644 --- a/doc/thread.qbk +++ b/doc/thread.qbk @@ -8,7 +8,7 @@ [library Thread [quickbook 1.5] - [version 4.7.2] + [version 4.8.0] [authors [Williams, Anthony] [Botet Escriba, Vicente J.]] [copyright 2007-11 Anthony Williams] [copyright 2011-16 Vicente J. Botet Escriba] From 13f3d7ed87b1d4222584c9a2ca7dfd3dea540bc6 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:48:11 +0200 Subject: [PATCH 13/15] Update changes. --- doc/changes.qbk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/changes.qbk b/doc/changes.qbk index 467bd8eb..ce2560d4 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -27,6 +27,8 @@ Please take a look at [@http://www.boost.org/development/tests/master/developer/ * [@http://svn.boost.org/trac/boost/ticket/13019 #13019] ABI compatibility for BOOST_THREAD_PROVIDES_INTERRUPTIONS incomplete * [@http://svn.boost.org/trac/boost/ticket/13163 #13163] boost::detail::heap_new does not have a variadic variant +* [@https://github.com/boostorg/thread/issues/130 #130] windows: Bug in boost::condition_variable on Windows + [heading Version 4.7.4 - boost 1.65] [*Fixed Bugs:] From 5920e4c7afb60dfef37c5eeaa265fa0748268e83 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:50:15 +0200 Subject: [PATCH 14/15] Update copyright. --- doc/thread.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/thread.qbk b/doc/thread.qbk index 65a95e77..c480d249 100644 --- a/doc/thread.qbk +++ b/doc/thread.qbk @@ -11,7 +11,7 @@ [version 4.8.0] [authors [Williams, Anthony] [Botet Escriba, Vicente J.]] [copyright 2007-11 Anthony Williams] - [copyright 2011-16 Vicente J. Botet Escriba] + [copyright 2011-17 Vicente J. Botet Escriba] [purpose C++ Library for launching threads and synchronizing data between them] [category text] [license From e99ec0a2839bab28af4398ddf76d66f25d633e9e Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Sat, 26 Aug 2017 10:50:51 +0200 Subject: [PATCH 15/15] Update copyright. --- doc/changes.qbk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changes.qbk b/doc/changes.qbk index ce2560d4..b5fb5089 100644 --- a/doc/changes.qbk +++ b/doc/changes.qbk @@ -1,6 +1,6 @@ [/ (C) Copyright 2007-11 Anthony Williams. - (C) Copyright 2011-16 Vicente J. Botet Escriba. + (C) Copyright 2011-17 Vicente J. Botet Escriba. 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).