From: Jonathan Wakely Date: Thu, 11 Dec 2014 17:58:22 +0000 (+0000) Subject: 3.cc: Only use a thread_local when __cxa_thread_atexit_impl is available. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b8c555ac7c30f83f0e81aa6207757059beef1890;p=gcc.git 3.cc: Only use a thread_local when __cxa_thread_atexit_impl is available. * testsuite/30_threads/condition_variable/members/3.cc: Only use a thread_local when __cxa_thread_atexit_impl is available. From-SVN: r218638 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ea6e3322a17..70396133bc8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2014-12-11 Jonathan Wakely + + * testsuite/30_threads/condition_variable/members/3.cc: Only use + a thread_local when __cxa_thread_atexit_impl is available. + 2014-12-10 Jonathan Wakely * include/bits/locale_facets.tcc (numpunct::_M_cache): Avoid calling diff --git a/libstdc++-v3/testsuite/30_threads/condition_variable/members/3.cc b/libstdc++-v3/testsuite/30_threads/condition_variable/members/3.cc index 0da545d1439..1788bcfeb8f 100644 --- a/libstdc++-v3/testsuite/30_threads/condition_variable/members/3.cc +++ b/libstdc++-v3/testsuite/30_threads/condition_variable/members/3.cc @@ -41,7 +41,12 @@ void func() { std::unique_lock lock{mx}; std::notify_all_at_thread_exit(cv, std::move(lock)); +#if _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL + // Correct order of thread_local destruction needs __cxa_thread_atexit_impl static thread_local Inc inc; +#else + Inc inc; +#endif } int main()