From: Paolo Carlini Date: Thu, 24 May 2007 22:18:07 +0000 (+0000) Subject: concurrence.h: Use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8679a8ef55e0969e7cbe633873dff15194c20438;p=gcc.git concurrence.h: Use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*. 2007-05-24 Paolo Carlini * include/ext/concurrence.h: Use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*. From-SVN: r125044 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 96da24af999..7e5513a89c1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,4 +1,8 @@ -2007-05-23 Steve Ellcey +2007-05-24 Paolo Carlini + + * include/ext/concurrence.h: Use __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*. + +2007-05-24 Steve Ellcey * Makefile.in: Regenerate. * configure: Regenerate. diff --git a/libstdc++-v3/include/ext/concurrence.h b/libstdc++-v3/include/ext/concurrence.h index 6efb2a6be08..de4934c63c5 100644 --- a/libstdc++-v3/include/ext/concurrence.h +++ b/libstdc++-v3/include/ext/concurrence.h @@ -53,9 +53,8 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // the current configuration. static const _Lock_policy __default_lock_policy = #ifdef __GTHREADS - // NB: This macro doesn't actually exist yet in the compiler, but is - // set somewhat haphazardly at configure time. -#ifdef _GLIBCXX_ATOMIC_BUILTINS +#if (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) \ + && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) _S_atomic; #else _S_mutex; @@ -63,7 +62,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) #else _S_single; #endif - + // NB: As this is used in libsupc++, need to only depend on // exception. No stdexception classes, no use of std::string. class __concurrence_lock_error : public std::exception