diff options
| author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-10 18:20:43 +0000 |
|---|---|---|
| committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-02-10 18:20:43 +0000 |
| commit | f06b90735bae23bedcc6e6c183bceeba88b2982a (patch) | |
| tree | 0dbe6745de2f1b55e6c7f809f4157e564668753a /libstdc++-v3/include/profile | |
| parent | dcee68b4a3d7d21bede3a5d6bf2a900d352a6af7 (diff) | |
| download | ppe42-gcc-f06b90735bae23bedcc6e6c183bceeba88b2982a.tar.gz ppe42-gcc-f06b90735bae23bedcc6e6c183bceeba88b2982a.zip | |
2012-02-10 Benjamin Kosnik <bkoz@redhat.com>
Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/51798 continued.
* acinclude.m4 (GLIBCXX_ENABLE_ATOMIC_BUILTINS): Use __atomic_*
builtins instead of __sync_* builtins for atomic functionality.
* include/bits/shared_ptr_base.h: Same.
* include/parallel/compatibility.h: Same.
* include/profile/impl/profiler_state.h: Same.
* include/tr1/shared_ptr.h: Same.
* libsupc++/eh_ptr.cc: Same.
* libsupc++/eh_throw.cc: Same.
* libsupc++/eh_tm.cc: Same.
* libsupc++/guard.cc: Same.
* configure: Regenerated.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184110 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/profile')
| -rw-r--r-- | libstdc++-v3/include/profile/impl/profiler_state.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libstdc++-v3/include/profile/impl/profiler_state.h b/libstdc++-v3/include/profile/impl/profiler_state.h index 111b97e0eca..573aa0eeb40 100644 --- a/libstdc++-v3/include/profile/impl/profiler_state.h +++ b/libstdc++-v3/include/profile/impl/profiler_state.h @@ -1,6 +1,6 @@ // -*- C++ -*- // -// Copyright (C) 2009, 2010 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -45,9 +45,12 @@ namespace __gnu_profile inline bool __turn(__state_type __s) - { return (_GLIBCXX_PROFILE_DATA(__state) - == __sync_val_compare_and_swap(&_GLIBCXX_PROFILE_DATA(__state), - __INVALID, __s)); } + { + __state_type inv(__INVALID); + return __atomic_compare_exchange_n(&_GLIBCXX_PROFILE_DATA(__state), + &inv, __s, true, __ATOMIC_ACQ_REL, + __ATOMIC_RELAXED); + } inline bool __turn_on() |

