tmp/tmphhwsd_c7/{from.md → to.md}
RENAMED
|
@@ -7,22 +7,22 @@ namespace std {
|
|
| 7 |
atomic_flag(const atomic_flag&) = delete;
|
| 8 |
atomic_flag& operator=(const atomic_flag&) = delete;
|
| 9 |
atomic_flag& operator=(const atomic_flag&) volatile = delete;
|
| 10 |
|
| 11 |
bool test(memory_order = memory_order::seq_cst) const volatile noexcept;
|
| 12 |
-
bool test(memory_order = memory_order::seq_cst) const noexcept;
|
| 13 |
bool test_and_set(memory_order = memory_order::seq_cst) volatile noexcept;
|
| 14 |
-
bool test_and_set(memory_order = memory_order::seq_cst) noexcept;
|
| 15 |
void clear(memory_order = memory_order::seq_cst) volatile noexcept;
|
| 16 |
-
void clear(memory_order = memory_order::seq_cst) noexcept;
|
| 17 |
|
| 18 |
void wait(bool, memory_order = memory_order::seq_cst) const volatile noexcept;
|
| 19 |
-
void wait(bool, memory_order = memory_order::seq_cst) const noexcept;
|
| 20 |
void notify_one() volatile noexcept;
|
| 21 |
-
void notify_one() noexcept;
|
| 22 |
void notify_all() volatile noexcept;
|
| 23 |
-
void notify_all() noexcept;
|
| 24 |
};
|
| 25 |
}
|
| 26 |
```
|
| 27 |
|
| 28 |
The `atomic_flag` type provides the classic test-and-set functionality.
|
|
@@ -40,36 +40,36 @@ constexpr atomic_flag::atomic_flag() noexcept;
|
|
| 40 |
|
| 41 |
*Effects:* Initializes `*this` to the clear state.
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
bool atomic_flag_test(const volatile atomic_flag* object) noexcept;
|
| 45 |
-
bool atomic_flag_test(const atomic_flag* object) noexcept;
|
| 46 |
bool atomic_flag_test_explicit(const volatile atomic_flag* object,
|
| 47 |
memory_order order) noexcept;
|
| 48 |
-
bool atomic_flag_test_explicit(const atomic_flag* object,
|
| 49 |
memory_order order) noexcept;
|
| 50 |
bool atomic_flag::test(memory_order order = memory_order::seq_cst) const volatile noexcept;
|
| 51 |
-
bool atomic_flag::test(memory_order order = memory_order::seq_cst) const noexcept;
|
| 52 |
```
|
| 53 |
|
| 54 |
For `atomic_flag_test`, let `order` be `memory_order::seq_cst`.
|
| 55 |
|
| 56 |
-
*Preconditions:* `order` is
|
| 57 |
-
`memory_order::
|
| 58 |
|
| 59 |
*Effects:* Memory is affected according to the value of `order`.
|
| 60 |
|
| 61 |
*Returns:* Atomically returns the value pointed to by `object` or
|
| 62 |
`this`.
|
| 63 |
|
| 64 |
``` cpp
|
| 65 |
bool atomic_flag_test_and_set(volatile atomic_flag* object) noexcept;
|
| 66 |
-
bool atomic_flag_test_and_set(atomic_flag* object) noexcept;
|
| 67 |
bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object, memory_order order) noexcept;
|
| 68 |
-
bool atomic_flag_test_and_set_explicit(atomic_flag* object, memory_order order) noexcept;
|
| 69 |
bool atomic_flag::test_and_set(memory_order order = memory_order::seq_cst) volatile noexcept;
|
| 70 |
-
bool atomic_flag::test_and_set(memory_order order = memory_order::seq_cst) noexcept;
|
| 71 |
```
|
| 72 |
|
| 73 |
*Effects:* Atomically sets the value pointed to by `object` or by `this`
|
| 74 |
to `true`. Memory is affected according to the value of `order`. These
|
| 75 |
operations are atomic read-modify-write
|
|
@@ -78,43 +78,42 @@ operations [[intro.multithread]].
|
|
| 78 |
*Returns:* Atomically, the value of the object immediately before the
|
| 79 |
effects.
|
| 80 |
|
| 81 |
``` cpp
|
| 82 |
void atomic_flag_clear(volatile atomic_flag* object) noexcept;
|
| 83 |
-
void atomic_flag_clear(atomic_flag* object) noexcept;
|
| 84 |
void atomic_flag_clear_explicit(volatile atomic_flag* object, memory_order order) noexcept;
|
| 85 |
-
void atomic_flag_clear_explicit(atomic_flag* object, memory_order order) noexcept;
|
| 86 |
void atomic_flag::clear(memory_order order = memory_order::seq_cst) volatile noexcept;
|
| 87 |
-
void atomic_flag::clear(memory_order order = memory_order::seq_cst) noexcept;
|
| 88 |
```
|
| 89 |
|
| 90 |
-
*Preconditions:*
|
| 91 |
-
`memory_order::
|
| 92 |
-
`memory_order::acq_rel`.
|
| 93 |
|
| 94 |
*Effects:* Atomically sets the value pointed to by `object` or by `this`
|
| 95 |
to `false`. Memory is affected according to the value of `order`.
|
| 96 |
|
| 97 |
``` cpp
|
| 98 |
void atomic_flag_wait(const volatile atomic_flag* object, bool old) noexcept;
|
| 99 |
-
void atomic_flag_wait(const atomic_flag* object, bool old) noexcept;
|
| 100 |
void atomic_flag_wait_explicit(const volatile atomic_flag* object,
|
| 101 |
bool old, memory_order order) noexcept;
|
| 102 |
-
void atomic_flag_wait_explicit(const atomic_flag* object,
|
| 103 |
bool old, memory_order order) noexcept;
|
| 104 |
void atomic_flag::wait(bool old, memory_order order =
|
| 105 |
memory_order::seq_cst) const volatile noexcept;
|
| 106 |
-
void atomic_flag::wait(bool old, memory_order order =
|
| 107 |
memory_order::seq_cst) const noexcept;
|
| 108 |
```
|
| 109 |
|
| 110 |
For `atomic_flag_wait`, let `order` be `memory_order::seq_cst`. Let
|
| 111 |
`flag` be `object` for the non-member functions and `this` for the
|
| 112 |
member functions.
|
| 113 |
|
| 114 |
-
*Preconditions:* `order` is
|
| 115 |
-
`memory_order::
|
| 116 |
|
| 117 |
*Effects:* Repeatedly performs the following steps, in order:
|
| 118 |
|
| 119 |
- Evaluates `flag->test(order) != old`.
|
| 120 |
- If the result of that evaluation is `true`, returns.
|
|
@@ -124,13 +123,13 @@ member functions.
|
|
| 124 |
*Remarks:* This function is an atomic waiting
|
| 125 |
operation [[atomics.wait]].
|
| 126 |
|
| 127 |
``` cpp
|
| 128 |
void atomic_flag_notify_one(volatile atomic_flag* object) noexcept;
|
| 129 |
-
void atomic_flag_notify_one(atomic_flag* object) noexcept;
|
| 130 |
void atomic_flag::notify_one() volatile noexcept;
|
| 131 |
-
void atomic_flag::notify_one() noexcept;
|
| 132 |
```
|
| 133 |
|
| 134 |
*Effects:* Unblocks the execution of at least one atomic waiting
|
| 135 |
operation that is eligible to be unblocked [[atomics.wait]] by this
|
| 136 |
call, if any such atomic waiting operations exist.
|
|
@@ -138,13 +137,13 @@ call, if any such atomic waiting operations exist.
|
|
| 138 |
*Remarks:* This function is an atomic notifying
|
| 139 |
operation [[atomics.wait]].
|
| 140 |
|
| 141 |
``` cpp
|
| 142 |
void atomic_flag_notify_all(volatile atomic_flag* object) noexcept;
|
| 143 |
-
void atomic_flag_notify_all(atomic_flag* object) noexcept;
|
| 144 |
void atomic_flag::notify_all() volatile noexcept;
|
| 145 |
-
void atomic_flag::notify_all() noexcept;
|
| 146 |
```
|
| 147 |
|
| 148 |
*Effects:* Unblocks the execution of all atomic waiting operations that
|
| 149 |
are eligible to be unblocked [[atomics.wait]] by this call.
|
| 150 |
|
|
|
|
| 7 |
atomic_flag(const atomic_flag&) = delete;
|
| 8 |
atomic_flag& operator=(const atomic_flag&) = delete;
|
| 9 |
atomic_flag& operator=(const atomic_flag&) volatile = delete;
|
| 10 |
|
| 11 |
bool test(memory_order = memory_order::seq_cst) const volatile noexcept;
|
| 12 |
+
constexpr bool test(memory_order = memory_order::seq_cst) const noexcept;
|
| 13 |
bool test_and_set(memory_order = memory_order::seq_cst) volatile noexcept;
|
| 14 |
+
constexpr bool test_and_set(memory_order = memory_order::seq_cst) noexcept;
|
| 15 |
void clear(memory_order = memory_order::seq_cst) volatile noexcept;
|
| 16 |
+
constexpr void clear(memory_order = memory_order::seq_cst) noexcept;
|
| 17 |
|
| 18 |
void wait(bool, memory_order = memory_order::seq_cst) const volatile noexcept;
|
| 19 |
+
constexpr void wait(bool, memory_order = memory_order::seq_cst) const noexcept;
|
| 20 |
void notify_one() volatile noexcept;
|
| 21 |
+
constexpr void notify_one() noexcept;
|
| 22 |
void notify_all() volatile noexcept;
|
| 23 |
+
constexpr void notify_all() noexcept;
|
| 24 |
};
|
| 25 |
}
|
| 26 |
```
|
| 27 |
|
| 28 |
The `atomic_flag` type provides the classic test-and-set functionality.
|
|
|
|
| 40 |
|
| 41 |
*Effects:* Initializes `*this` to the clear state.
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
bool atomic_flag_test(const volatile atomic_flag* object) noexcept;
|
| 45 |
+
constexpr bool atomic_flag_test(const atomic_flag* object) noexcept;
|
| 46 |
bool atomic_flag_test_explicit(const volatile atomic_flag* object,
|
| 47 |
memory_order order) noexcept;
|
| 48 |
+
constexpr bool atomic_flag_test_explicit(const atomic_flag* object,
|
| 49 |
memory_order order) noexcept;
|
| 50 |
bool atomic_flag::test(memory_order order = memory_order::seq_cst) const volatile noexcept;
|
| 51 |
+
constexpr bool atomic_flag::test(memory_order order = memory_order::seq_cst) const noexcept;
|
| 52 |
```
|
| 53 |
|
| 54 |
For `atomic_flag_test`, let `order` be `memory_order::seq_cst`.
|
| 55 |
|
| 56 |
+
*Preconditions:* `order` is `memory_order::relaxed`,
|
| 57 |
+
`memory_order::acquire`, or `memory_order::seq_cst`.
|
| 58 |
|
| 59 |
*Effects:* Memory is affected according to the value of `order`.
|
| 60 |
|
| 61 |
*Returns:* Atomically returns the value pointed to by `object` or
|
| 62 |
`this`.
|
| 63 |
|
| 64 |
``` cpp
|
| 65 |
bool atomic_flag_test_and_set(volatile atomic_flag* object) noexcept;
|
| 66 |
+
constexpr bool atomic_flag_test_and_set(atomic_flag* object) noexcept;
|
| 67 |
bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object, memory_order order) noexcept;
|
| 68 |
+
constexpr bool atomic_flag_test_and_set_explicit(atomic_flag* object, memory_order order) noexcept;
|
| 69 |
bool atomic_flag::test_and_set(memory_order order = memory_order::seq_cst) volatile noexcept;
|
| 70 |
+
constexpr bool atomic_flag::test_and_set(memory_order order = memory_order::seq_cst) noexcept;
|
| 71 |
```
|
| 72 |
|
| 73 |
*Effects:* Atomically sets the value pointed to by `object` or by `this`
|
| 74 |
to `true`. Memory is affected according to the value of `order`. These
|
| 75 |
operations are atomic read-modify-write
|
|
|
|
| 78 |
*Returns:* Atomically, the value of the object immediately before the
|
| 79 |
effects.
|
| 80 |
|
| 81 |
``` cpp
|
| 82 |
void atomic_flag_clear(volatile atomic_flag* object) noexcept;
|
| 83 |
+
constexpr void atomic_flag_clear(atomic_flag* object) noexcept;
|
| 84 |
void atomic_flag_clear_explicit(volatile atomic_flag* object, memory_order order) noexcept;
|
| 85 |
+
constexpr void atomic_flag_clear_explicit(atomic_flag* object, memory_order order) noexcept;
|
| 86 |
void atomic_flag::clear(memory_order order = memory_order::seq_cst) volatile noexcept;
|
| 87 |
+
constexpr void atomic_flag::clear(memory_order order = memory_order::seq_cst) noexcept;
|
| 88 |
```
|
| 89 |
|
| 90 |
+
*Preconditions:* `order` is `memory_order::relaxed`,
|
| 91 |
+
`memory_order::release`, or `memory_order::seq_cst`.
|
|
|
|
| 92 |
|
| 93 |
*Effects:* Atomically sets the value pointed to by `object` or by `this`
|
| 94 |
to `false`. Memory is affected according to the value of `order`.
|
| 95 |
|
| 96 |
``` cpp
|
| 97 |
void atomic_flag_wait(const volatile atomic_flag* object, bool old) noexcept;
|
| 98 |
+
constexpr void atomic_flag_wait(const atomic_flag* object, bool old) noexcept;
|
| 99 |
void atomic_flag_wait_explicit(const volatile atomic_flag* object,
|
| 100 |
bool old, memory_order order) noexcept;
|
| 101 |
+
constexpr void atomic_flag_wait_explicit(const atomic_flag* object,
|
| 102 |
bool old, memory_order order) noexcept;
|
| 103 |
void atomic_flag::wait(bool old, memory_order order =
|
| 104 |
memory_order::seq_cst) const volatile noexcept;
|
| 105 |
+
constexpr void atomic_flag::wait(bool old, memory_order order =
|
| 106 |
memory_order::seq_cst) const noexcept;
|
| 107 |
```
|
| 108 |
|
| 109 |
For `atomic_flag_wait`, let `order` be `memory_order::seq_cst`. Let
|
| 110 |
`flag` be `object` for the non-member functions and `this` for the
|
| 111 |
member functions.
|
| 112 |
|
| 113 |
+
*Preconditions:* `order` is `memory_order::relaxed`,
|
| 114 |
+
`memory_order::acquire`, or `memory_order::seq_cst`.
|
| 115 |
|
| 116 |
*Effects:* Repeatedly performs the following steps, in order:
|
| 117 |
|
| 118 |
- Evaluates `flag->test(order) != old`.
|
| 119 |
- If the result of that evaluation is `true`, returns.
|
|
|
|
| 123 |
*Remarks:* This function is an atomic waiting
|
| 124 |
operation [[atomics.wait]].
|
| 125 |
|
| 126 |
``` cpp
|
| 127 |
void atomic_flag_notify_one(volatile atomic_flag* object) noexcept;
|
| 128 |
+
constexpr void atomic_flag_notify_one(atomic_flag* object) noexcept;
|
| 129 |
void atomic_flag::notify_one() volatile noexcept;
|
| 130 |
+
constexpr void atomic_flag::notify_one() noexcept;
|
| 131 |
```
|
| 132 |
|
| 133 |
*Effects:* Unblocks the execution of at least one atomic waiting
|
| 134 |
operation that is eligible to be unblocked [[atomics.wait]] by this
|
| 135 |
call, if any such atomic waiting operations exist.
|
|
|
|
| 137 |
*Remarks:* This function is an atomic notifying
|
| 138 |
operation [[atomics.wait]].
|
| 139 |
|
| 140 |
``` cpp
|
| 141 |
void atomic_flag_notify_all(volatile atomic_flag* object) noexcept;
|
| 142 |
+
constexpr void atomic_flag_notify_all(atomic_flag* object) noexcept;
|
| 143 |
void atomic_flag::notify_all() volatile noexcept;
|
| 144 |
+
constexpr void atomic_flag::notify_all() noexcept;
|
| 145 |
```
|
| 146 |
|
| 147 |
*Effects:* Unblocks the execution of all atomic waiting operations that
|
| 148 |
are eligible to be unblocked [[atomics.wait]] by this call.
|
| 149 |
|