From Jason Turner

[atomics.flag]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpgm66tj23/{from.md → to.md} +19 -5
tmp/tmpgm66tj23/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- ## Flag type and operations <a id="atomics.flag">[[atomics.flag]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
  struct atomic_flag {
6
  constexpr atomic_flag() noexcept;
@@ -26,14 +26,12 @@ namespace std {
26
  ```
27
 
28
  The `atomic_flag` type provides the classic test-and-set functionality.
29
  It has two states, set and clear.
30
 
31
- Operations on an object of type `atomic_flag` shall be lock-free.
32
-
33
- [*Note 1*: Hence the operations should also be
34
- address-free. — *end note*]
35
 
36
  The `atomic_flag` type is a standard-layout struct. It has a trivial
37
  destructor.
38
 
39
  ``` cpp
@@ -151,5 +149,21 @@ void atomic_flag::notify_all() noexcept;
151
  are eligible to be unblocked [[atomics.wait]] by this call.
152
 
153
  *Remarks:* This function is an atomic notifying
154
  operation [[atomics.wait]].
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Flag type and operations <a id="atomics.flag">[[atomics.flag]]</a>
2
 
3
  ``` cpp
4
  namespace std {
5
  struct atomic_flag {
6
  constexpr atomic_flag() noexcept;
 
26
  ```
27
 
28
  The `atomic_flag` type provides the classic test-and-set functionality.
29
  It has two states, set and clear.
30
 
31
+ Operations on an object of type `atomic_flag` shall be lock-free. The
32
+ operations should also be address-free.
 
 
33
 
34
  The `atomic_flag` type is a standard-layout struct. It has a trivial
35
  destructor.
36
 
37
  ``` cpp
 
149
  are eligible to be unblocked [[atomics.wait]] by this call.
150
 
151
  *Remarks:* This function is an atomic notifying
152
  operation [[atomics.wait]].
153
 
154
+ ``` cpp
155
+ #define ATOMIC_FLAG_INIT see below
156
+ ```
157
+
158
+ *Remarks:* The macro `ATOMIC_FLAG_INIT` is defined in such a way that it
159
+ can be used to initialize an object of type `atomic_flag` to the clear
160
+ state. The macro can be used in the form:
161
+
162
+ ``` cpp
163
+ atomic_flag guard = ATOMIC_FLAG_INIT;
164
+ ```
165
+
166
+ It is unspecified whether the macro can be used in other initialization
167
+ contexts. For a complete static-duration object, that initialization
168
+ shall be static.
169
+