aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/atomic
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/atomic')
-rw-r--r--libcxx/include/atomic31
1 files changed, 11 insertions, 20 deletions
diff --git a/libcxx/include/atomic b/libcxx/include/atomic
index bd49367a3246..0c6d3079c96a 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -518,7 +518,9 @@ template <class T>
*/
+#include <__assert> // all public C++ headers provide the assertion handler
#include <__availability>
+#include <__chrono/duration.h>
#include <__config>
#include <__thread/poll_with_backoff.h>
#include <__thread/timed_backoff_policy.h>
@@ -532,15 +534,19 @@ template <class T>
# include <__threading_support>
#endif
+#ifndef _LIBCPP_REMOVE_TRANSITIVE_INCLUDES
+# include <chrono>
+#endif
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
+# pragma GCC system_header
#endif
#ifdef _LIBCPP_HAS_NO_ATOMIC_HEADER
# error <atomic> is not implemented
#endif
#ifdef kill_dependency
-# error C++ standard library is incompatible with <stdatomic.h>
+# error <atomic> is incompatible with <stdatomic.h> before C++23. Please compile with -std=c++23.
#endif
#define _LIBCPP_CHECK_STORE_MEMORY_ORDER(__m) \
@@ -1449,11 +1455,11 @@ struct __cxx_atomic_impl : public _Base {
: _Base(value) {}
};
-#ifdef __linux__
+#if defined(__linux__) || (defined(_AIX) && !defined(__64BIT__))
using __cxx_contention_t = int32_t;
#else
using __cxx_contention_t = int64_t;
-#endif //__linux__
+#endif // __linux__ || (_AIX && !__64BIT__)
using __cxx_atomic_contention_t = __cxx_atomic_impl<__cxx_contention_t>;
@@ -1651,13 +1657,7 @@ struct __atomic_base // false
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
__atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
-#ifndef _LIBCPP_CXX03_LANG
__atomic_base(const __atomic_base&) = delete;
-#else
-private:
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base(const __atomic_base&);
-#endif
};
#if defined(__cpp_lib_atomic_is_always_lock_free)
@@ -2439,19 +2439,10 @@ typedef struct atomic_flag
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
-#ifndef _LIBCPP_CXX03_LANG
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) volatile = delete;
-#else
-private:
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag(const atomic_flag&);
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag& operator=(const atomic_flag&);
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag& operator=(const atomic_flag&) volatile;
-#endif
+
} atomic_flag;