3.cc: Only use a thread_local when __cxa_thread_atexit_impl is available.
authorJonathan Wakely <jwakely@redhat.com>
Thu, 11 Dec 2014 17:58:22 +0000 (17:58 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 11 Dec 2014 17:58:22 +0000 (17:58 +0000)
* testsuite/30_threads/condition_variable/members/3.cc: Only use
a thread_local when __cxa_thread_atexit_impl is available.

From-SVN: r218638

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/30_threads/condition_variable/members/3.cc

index ea6e3322a17afd3fcb7604da3fa8b5a20157a5d2..70396133bc8b6c2762a29ea3c7197ab22a1d29ea 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-11  Jonathan Wakely  <jwakely@redhat.com>
+
+       * 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  <jwakely@redhat.com>
 
        * include/bits/locale_facets.tcc (numpunct::_M_cache): Avoid calling
index 0da545d1439c47af75c567303adf85e9f4f454ca..1788bcfeb8f6ad18ff9badf5d46d42125c74b828 100644 (file)
@@ -41,7 +41,12 @@ void func()
 {
   std::unique_lock<std::mutex> 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()