diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2011-12-01 02:20:32 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2011-12-01 02:20:32 +0000 |
commit | a152e96f01344f3e3200c53a10d992420976b8d2 (patch) | |
tree | d4912787d66dc0363f377302abaa209272a433b0 /libstdc++-v3/include | |
parent | de21ce7fa8f64a4438874ede019e77034de43310 (diff) | |
download | gcc-a152e96f01344f3e3200c53a10d992420976b8d2.tar.gz |
acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove size-specific macros.
2011-11-30 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Remove
size-specific macros. _GLIBCXX_ATOMIC_BUILTINS_1,
_GLIBCXX_ATOMIC_BUILTINS_2, _GLIBCXX_ATOMIC_BUILTINS_4,
_GLIBCXX_ATOMIC_BUILTINS_8. Use _GLIBCXX_ATOMIC_BUILTINS to
indicate use of C++11 atomic builtins.
* config.h.in: Regenerate.
* configure: Regenerate.
* include/Makefile.am (bits_sup_headers): Add atomic_lockfree_defines.h.
* include/Makefile.in: Regenerate.
* libsupc++/Makefile.am: Compile C++11 support with -std=gnu++0x.
* libsupc++/Makefile.in: Regenerate.
* include/bits/atomic_base.h: Move lock-free property macros...
* libsupc++/atomic_lockfree_defines.h: ...here.
* include/std/future: Use C++11 macros.
* libsupc++/eh_ptr.cc: Same.
* libsupc++/eh_throw.cc: Same.
* libsupc++/exception: Same.
* libsupc++/exception_ptr.h: Same.
* libsupc++/guard.cc: Same.
* libsupc++/nested_exception.cc: Same.
* libsupc++/nested_exception.h: Same.
* src/future.cc: Same.
* include/ext/atomicity.h: Use _GLIBCXX_ATOMIC_BUILTINS.
* doc/doxygen/user.cfg.in
* doc/xml/manual/concurrency_extensions.xml
* testsuite/18_support/exception_ptr/lifespan.cc
* testsuite/lib/libstdc++.exp
From-SVN: r181869
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/Makefile.am | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/Makefile.in | 1 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/atomic_base.h | 22 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/atomicity.h | 4 | ||||
-rw-r--r-- | libstdc++-v3/include/std/future | 4 |
5 files changed, 9 insertions, 23 deletions
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 121a6427ec2..1e9b144a07d 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -177,6 +177,7 @@ bits_headers = \ bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ bits_sup_headers = \ + ${bits_sup_srcdir}/atomic_lockfree_defines.h \ ${bits_sup_srcdir}/cxxabi_forced.h \ ${bits_sup_srcdir}/exception_defines.h \ ${bits_sup_srcdir}/exception_ptr.h \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 70c0781d513..fec2d94bf7b 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -429,6 +429,7 @@ bits_headers = \ bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++ bits_sup_headers = \ + ${bits_sup_srcdir}/atomic_lockfree_defines.h \ ${bits_sup_srcdir}/cxxabi_forced.h \ ${bits_sup_srcdir}/exception_defines.h \ ${bits_sup_srcdir}/exception_ptr.h \ diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 2711323bbda..3f00cda6775 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -35,6 +35,7 @@ #include <bits/c++config.h> #include <stdbool.h> #include <stdint.h> +#include <bits/atomic_lockfree_defines.h> namespace std _GLIBCXX_VISIBILITY(default) { @@ -70,15 +71,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline void atomic_thread_fence(memory_order __m) noexcept - { - __atomic_thread_fence (__m); - } + { __atomic_thread_fence(__m); } inline void atomic_signal_fence(memory_order __m) noexcept - { - __atomic_thread_fence (__m); - } + { __atomic_thread_fence(__m); } /// kill_dependency template<typename _Tp> @@ -89,19 +86,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __ret; } - /// Lock-free Property - - -#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE -#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE -#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE -#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE -#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE -#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE -#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE -#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE -#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE -#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE // Base types for atomics. template<typename _IntTp> diff --git a/libstdc++-v3/include/ext/atomicity.h b/libstdc++-v3/include/ext/atomicity.h index f0c775216c5..c63b1d46361 100644 --- a/libstdc++-v3/include/ext/atomicity.h +++ b/libstdc++-v3/include/ext/atomicity.h @@ -1,6 +1,6 @@ // Support for atomic operations -*- C++ -*- -// Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010 +// Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -42,7 +42,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // To abstract locking primitives across all thread policies, use: // __exchange_and_add_dispatch // __atomic_add_dispatch -#ifdef _GLIBCXX_ATOMIC_BUILTINS_4 +#ifdef _GLIBCXX_ATOMIC_BUILTINS static inline _Atomic_word __exchange_and_add(volatile _Atomic_word* __mem, int __val) { return __sync_fetch_and_add(__mem, __val); } diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index bfd1ff9e9bb..040f573ea72 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -187,7 +187,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION async(_Fn&& __fn, _Args&&... __args); #if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \ - && defined(_GLIBCXX_ATOMIC_BUILTINS_4) + && (ATOMIC_INT_LOCK_FREE > 1) /// Base class and enclosing scope. struct __future_base @@ -1493,7 +1493,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } #endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1 - // && _GLIBCXX_ATOMIC_BUILTINS_4 + // && ATOMIC_INT_LOCK_FREE // @} group futures _GLIBCXX_END_NAMESPACE_VERSION |