diff options
author | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 17:26:23 +0000 |
---|---|---|
committer | David Chisnall <csdavec@swan.ac.uk> | 2012-04-11 17:26:23 +0000 |
commit | cd42f9446bc94557ebf128e21d7a06ea69b9d7b7 (patch) | |
tree | 8e8b63f6759e4cea9393e7ee7443897654b78b8a /libcxx | |
parent | eb9496efc7739c0b4c6170cb6dc302dc3cac3591 (diff) | |
download | bcm5719-llvm-cd42f9446bc94557ebf128e21d7a06ea69b9d7b7.tar.gz bcm5719-llvm-cd42f9446bc94557ebf128e21d7a06ea69b9d7b7.zip |
Now that clang supports doing the right thing with regard to atomic
initialisation, do the right thing with regard to atomic initialisation.
Note: clang r154507 or later required for <atomic> to work now.
llvm-svn: 154508
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/atomic | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/atomic b/libcxx/include/atomic index 6a02b5dc9da..195aeefbfa0 100644 --- a/libcxx/include/atomic +++ b/libcxx/include/atomic @@ -621,7 +621,7 @@ struct __atomic_base // false _LIBCPP_INLINE_VISIBILITY __atomic_base() {} // = default; _LIBCPP_INLINE_VISIBILITY - /*constexpr*/ __atomic_base(_Tp __d) { __atomic_store(&__a_, __d, memory_order_seq_cst); } + /*constexpr*/ __atomic_base(_Tp __d) : __a_(__d) {} #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS __atomic_base(const __atomic_base&) = delete; __atomic_base& operator=(const __atomic_base&) = delete; @@ -820,7 +820,7 @@ inline _LIBCPP_INLINE_VISIBILITY void atomic_init(volatile atomic<_Tp>* __o, _Tp __d) { - __atomic_store(&__o->__a_, __d, memory_order_seq_cst); + __atomic_init(&__o->__a_, __d); } template <class _Tp> @@ -828,7 +828,7 @@ inline _LIBCPP_INLINE_VISIBILITY void atomic_init(atomic<_Tp>* __o, _Tp __d) { - __atomic_store(&__o->__a_, __d, memory_order_seq_cst); + __atomic_init(&__o->__a_, __d); } // atomic_store @@ -1366,7 +1366,7 @@ typedef struct atomic_flag _LIBCPP_INLINE_VISIBILITY atomic_flag() {} // = default; _LIBCPP_INLINE_VISIBILITY - atomic_flag(bool __b) { __atomic_store(&__a_, __b, memory_order_seq_cst); } + atomic_flag(bool __b) : __a_(__b) {} #ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS atomic_flag(const atomic_flag&) = delete; |