summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/atomic
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2012-03-14 00:09:36 +0000
committertheraven <theraven@FreeBSD.org>2012-03-14 00:09:36 +0000
commit7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19 (patch)
tree077f044b08d256dd8348f977fe56d18c08fccd78 /contrib/libc++/include/atomic
parentd83b894ff4280333de5ef40496cfd061b515ba54 (diff)
parentbaa75b9984d33ea49ffb76a73507b64d879166cc (diff)
downloadFreeBSD-src-7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19.zip
FreeBSD-src-7bd22d0949674b61e2c1a97cbb6caeeb5ab7fd19.tar.gz
Import new versions of libcxxrt and libc++.
Please tests any C++ code you care about with -stdlib=libc++! Approved by: dim (mentor)
Diffstat (limited to 'contrib/libc++/include/atomic')
-rw-r--r--contrib/libc++/include/atomic12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/libc++/include/atomic b/contrib/libc++/include/atomic
index 244f42d..f2e428a 100644
--- a/contrib/libc++/include/atomic
+++ b/contrib/libc++/include/atomic
@@ -555,7 +555,7 @@ kill_dependency(_Tp __y)
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
struct __atomic_base // false
{
- _Tp __a_;
+ _Atomic(_Tp) __a_;
_LIBCPP_INLINE_VISIBILITY
bool is_lock_free() const volatile
@@ -621,7 +621,7 @@ struct __atomic_base // false
_LIBCPP_INLINE_VISIBILITY
__atomic_base() {} // = default;
_LIBCPP_INLINE_VISIBILITY
- /*constexpr*/ __atomic_base(_Tp __d) : __a_(__d) {}
+ /*constexpr*/ __atomic_base(_Tp __d) { __atomic_store(&__a_, __d, memory_order_seq_cst); }
#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)
{
- __o->__a_ = __d;
+ __atomic_store(&__o->__a_, __d, memory_order_seq_cst);
}
template <class _Tp>
@@ -828,7 +828,7 @@ inline _LIBCPP_INLINE_VISIBILITY
void
atomic_init(atomic<_Tp>* __o, _Tp __d)
{
- __o->__a_ = __d;
+ __atomic_store(&__o->__a_, __d, memory_order_seq_cst);
}
// atomic_store
@@ -1348,7 +1348,7 @@ atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m)
typedef struct atomic_flag
{
- bool __a_;
+ _Atomic(bool) __a_;
_LIBCPP_INLINE_VISIBILITY
bool test_and_set(memory_order __m = memory_order_seq_cst) volatile
@@ -1366,7 +1366,7 @@ typedef struct atomic_flag
_LIBCPP_INLINE_VISIBILITY
atomic_flag() {} // = default;
_LIBCPP_INLINE_VISIBILITY
- atomic_flag(bool __b) : __a_(__b) {}
+ atomic_flag(bool __b) { __atomic_store(&__a_, __b, memory_order_seq_cst); }
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
atomic_flag(const atomic_flag&) = delete;
OpenPOWER on IntegriCloud