tmp/tmpmdpi0yxt/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### C compatibility <a id="stdatomic.h.syn">[[stdatomic.h.syn]]</a>
|
| 2 |
+
|
| 3 |
+
The header `<stdatomic.h>` provides the following definitions:
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
template<class T>
|
| 7 |
+
using std-atomic = std::atomic<T>; // exposition only
|
| 8 |
+
|
| 9 |
+
#define _Atomic(T) std-atomic<T>
|
| 10 |
+
|
| 11 |
+
#define ATOMIC_BOOL_LOCK_FREE see below
|
| 12 |
+
#define ATOMIC_CHAR_LOCK_FREE see below
|
| 13 |
+
#define ATOMIC_CHAR16_T_LOCK_FREE see below
|
| 14 |
+
#define ATOMIC_CHAR32_T_LOCK_FREE see below
|
| 15 |
+
#define ATOMIC_WCHAR_T_LOCK_FREE see below
|
| 16 |
+
#define ATOMIC_SHORT_LOCK_FREE see below
|
| 17 |
+
#define ATOMIC_INT_LOCK_FREE see below
|
| 18 |
+
#define ATOMIC_LONG_LOCK_FREE see below
|
| 19 |
+
#define ATOMIC_LLONG_LOCK_FREE see below
|
| 20 |
+
#define ATOMIC_POINTER_LOCK_FREE see below
|
| 21 |
+
|
| 22 |
+
using std::memory_order; // see below
|
| 23 |
+
using std::memory_order_relaxed; // see below
|
| 24 |
+
using std::memory_order_consume; // see below
|
| 25 |
+
using std::memory_order_acquire; // see below
|
| 26 |
+
using std::memory_order_release; // see below
|
| 27 |
+
using std::memory_order_acq_rel; // see below
|
| 28 |
+
using std::memory_order_seq_cst; // see below
|
| 29 |
+
|
| 30 |
+
using std::atomic_flag; // see below
|
| 31 |
+
|
| 32 |
+
using std::atomic_bool; // see below
|
| 33 |
+
using std::atomic_char; // see below
|
| 34 |
+
using std::atomic_schar; // see below
|
| 35 |
+
using std::atomic_uchar; // see below
|
| 36 |
+
using std::atomic_short; // see below
|
| 37 |
+
using std::atomic_ushort; // see below
|
| 38 |
+
using std::atomic_int; // see below
|
| 39 |
+
using std::atomic_uint; // see below
|
| 40 |
+
using std::atomic_long; // see below
|
| 41 |
+
using std::atomic_ulong; // see below
|
| 42 |
+
using std::atomic_llong; // see below
|
| 43 |
+
using std::atomic_ullong; // see below
|
| 44 |
+
using std::atomic_char8_t; // see below
|
| 45 |
+
using std::atomic_char16_t; // see below
|
| 46 |
+
using std::atomic_char32_t; // see below
|
| 47 |
+
using std::atomic_wchar_t; // see below
|
| 48 |
+
using std::atomic_int8_t; // see below
|
| 49 |
+
using std::atomic_uint8_t; // see below
|
| 50 |
+
using std::atomic_int16_t; // see below
|
| 51 |
+
using std::atomic_uint16_t; // see below
|
| 52 |
+
using std::atomic_int32_t; // see below
|
| 53 |
+
using std::atomic_uint32_t; // see below
|
| 54 |
+
using std::atomic_int64_t; // see below
|
| 55 |
+
using std::atomic_uint64_t; // see below
|
| 56 |
+
using std::atomic_int_least8_t; // see below
|
| 57 |
+
using std::atomic_uint_least8_t; // see below
|
| 58 |
+
using std::atomic_int_least16_t; // see below
|
| 59 |
+
using std::atomic_uint_least16_t; // see below
|
| 60 |
+
using std::atomic_int_least32_t; // see below
|
| 61 |
+
using std::atomic_uint_least32_t; // see below
|
| 62 |
+
using std::atomic_int_least64_t; // see below
|
| 63 |
+
using std::atomic_uint_least64_t; // see below
|
| 64 |
+
using std::atomic_int_fast8_t; // see below
|
| 65 |
+
using std::atomic_uint_fast8_t; // see below
|
| 66 |
+
using std::atomic_int_fast16_t; // see below
|
| 67 |
+
using std::atomic_uint_fast16_t; // see below
|
| 68 |
+
using std::atomic_int_fast32_t; // see below
|
| 69 |
+
using std::atomic_uint_fast32_t; // see below
|
| 70 |
+
using std::atomic_int_fast64_t; // see below
|
| 71 |
+
using std::atomic_uint_fast64_t; // see below
|
| 72 |
+
using std::atomic_intptr_t; // see below
|
| 73 |
+
using std::atomic_uintptr_t; // see below
|
| 74 |
+
using std::atomic_size_t; // see below
|
| 75 |
+
using std::atomic_ptrdiff_t; // see below
|
| 76 |
+
using std::atomic_intmax_t; // see below
|
| 77 |
+
using std::atomic_uintmax_t; // see below
|
| 78 |
+
|
| 79 |
+
using std::atomic_is_lock_free; // see below
|
| 80 |
+
using std::atomic_load; // see below
|
| 81 |
+
using std::atomic_load_explicit; // see below
|
| 82 |
+
using std::atomic_store; // see below
|
| 83 |
+
using std::atomic_store_explicit; // see below
|
| 84 |
+
using std::atomic_exchange; // see below
|
| 85 |
+
using std::atomic_exchange_explicit; // see below
|
| 86 |
+
using std::atomic_compare_exchange_strong; // see below
|
| 87 |
+
using std::atomic_compare_exchange_strong_explicit; // see below
|
| 88 |
+
using std::atomic_compare_exchange_weak; // see below
|
| 89 |
+
using std::atomic_compare_exchange_weak_explicit; // see below
|
| 90 |
+
using std::atomic_fetch_add; // see below
|
| 91 |
+
using std::atomic_fetch_add_explicit; // see below
|
| 92 |
+
using std::atomic_fetch_sub; // see below
|
| 93 |
+
using std::atomic_fetch_sub_explicit; // see below
|
| 94 |
+
using std::atomic_fetch_and; // see below
|
| 95 |
+
using std::atomic_fetch_and_explicit; // see below
|
| 96 |
+
using std::atomic_fetch_or; // see below
|
| 97 |
+
using std::atomic_fetch_or_explicit; // see below
|
| 98 |
+
using std::atomic_fetch_xor; // see below
|
| 99 |
+
using std::atomic_fetch_xor_explicit; // see below
|
| 100 |
+
using std::atomic_flag_test_and_set; // see below
|
| 101 |
+
using std::atomic_flag_test_and_set_explicit; // see below
|
| 102 |
+
using std::atomic_flag_clear; // see below
|
| 103 |
+
using std::atomic_flag_clear_explicit; // see below
|
| 104 |
+
#define ATOMIC_FLAG_INIT see below
|
| 105 |
+
|
| 106 |
+
using std::atomic_thread_fence; // see below
|
| 107 |
+
using std::atomic_signal_fence; // see below
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
Each *using-declaration* for some name A in the synopsis above makes
|
| 111 |
+
available the same entity as `std::A` declared in `<atomic>`. Each macro
|
| 112 |
+
listed above other than `_Atomic(T)` is defined as in `<atomic>`. It is
|
| 113 |
+
unspecified whether `<stdatomic.h>` makes available any declarations in
|
| 114 |
+
namespace `std`.
|
| 115 |
+
|
| 116 |
+
Each of the *using-declaration*s for `intN_t`, `uintN_t`, `intptr_t`,
|
| 117 |
+
and `uintptr_t` listed above is defined if and only if the
|
| 118 |
+
implementation defines the corresponding *typedef-name* in
|
| 119 |
+
[[atomics.syn]].
|
| 120 |
+
|
| 121 |
+
Neither the `_Atomic` macro, nor any of the non-macro global namespace
|
| 122 |
+
declarations, are provided by any C++ standard library header other than
|
| 123 |
+
`<stdatomic.h>`.
|
| 124 |
+
|
| 125 |
+
*Recommended practice:* Implementations should ensure that C and C++
|
| 126 |
+
representations of atomic objects are compatible, so that the same
|
| 127 |
+
object can be accessed as both an `_Atomic(T)` from C code and an
|
| 128 |
+
`atomic<T>` from C++ code. The representations should be the same, and
|
| 129 |
+
the mechanisms used to ensure atomicity and memory ordering should be
|
| 130 |
+
compatible.
|
| 131 |
+
|