diff --git a/doc/changes.qbk b/doc/changes.qbk index 31ea573c..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). @@ -8,6 +8,49 @@ [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 + +* [@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:] + +* [@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 +70,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..c480d249 100644 --- a/doc/thread.qbk +++ b/doc/thread.qbk @@ -8,10 +8,10 @@ [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] + [copyright 2011-17 Vicente J. Botet Escriba] [purpose C++ Library for launching threads and synchronizing data between them] [category text] [license diff --git a/include/boost/thread/detail/config.hpp b/include/boost/thread/detail/config.hpp index 9eff05f5..2987de66 100644 --- a/include/boost/thread/detail/config.hpp +++ b/include/boost/thread/detail/config.hpp @@ -12,21 +12,19 @@ #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(__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 diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 6424e483..b91adee0 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; @@ -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/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/include/boost/thread/pthread/condition_variable_fwd.hpp b/include/boost/thread/pthread/condition_variable_fwd.hpp index 802a5cc6..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: @@ -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())); @@ -90,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); 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 diff --git a/include/boost/thread/pthread/thread_data.hpp b/include/boost/thread/pthread/thread_data.hpp index 836e6927..41563ebc 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