[cfe-commits] [libcxx] r154508 - /libcxx/trunk/include/atomic

David Chisnall csdavec at swan.ac.uk
Wed Apr 11 10:26:23 PDT 2012


Author: theraven
Date: Wed Apr 11 12:26:23 2012
New Revision: 154508

URL: http://llvm.org/viewvc/llvm-project?rev=154508&view=rev
Log:
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.


Modified:
    libcxx/trunk/include/atomic

Modified: libcxx/trunk/include/atomic
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/atomic?rev=154508&r1=154507&r2=154508&view=diff
==============================================================================
--- libcxx/trunk/include/atomic (original)
+++ libcxx/trunk/include/atomic Wed Apr 11 12:26:23 2012
@@ -621,7 +621,7 @@
     _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 @@
 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 @@
 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 @@
     _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;





More information about the cfe-commits mailing list