summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/tr1
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-10 18:20:43 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-10 18:20:43 +0000
commitf06b90735bae23bedcc6e6c183bceeba88b2982a (patch)
tree0dbe6745de2f1b55e6c7f809f4157e564668753a /libstdc++-v3/include/tr1
parentdcee68b4a3d7d21bede3a5d6bf2a900d352a6af7 (diff)
downloadgcc-f06b90735bae23bedcc6e6c183bceeba88b2982a.tar.gz
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/tr1')
-rw-r--r--libstdc++-v3/include/tr1/shared_ptr.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h
index c42084c9539..723e317646d 100644
--- a/libstdc++-v3/include/tr1/shared_ptr.h
+++ b/libstdc++-v3/include/tr1/shared_ptr.h
@@ -1,6 +1,7 @@
// <tr1/shared_ptr.h> -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011, 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
@@ -246,9 +247,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// Replace the current counter value with the old value + 1, as
// long as it's not changed meanwhile.
}
- while (!__sync_bool_compare_and_swap(&_M_use_count, __count,
- __count + 1));
- }
+ while (!__atomic_compare_exchange_n(&_M_use_count, &__count, __count + 1,
+ true, __ATOMIC_ACQ_REL,
+ __ATOMIC_RELAXED));
+ }
template<typename _Ptr, typename _Deleter, _Lock_policy _Lp>
class _Sp_counted_base_impl