From Jason Turner

[atomics.flag]

Diff to HTML by rtfpessoa

tmp/tmpbt__o7ee/{from.md → to.md} RENAMED
@@ -41,18 +41,22 @@ The `atomic_flag` type shall have standard layout. It shall have a
41
  trivial default constructor, a deleted copy constructor, a deleted copy
42
  assignment operator, and a trivial destructor.
43
 
44
  The macro `ATOMIC_FLAG_INIT` shall be defined in such a way that it can
45
  be used to initialize an object of type `atomic_flag` to the clear
46
- state. For a static-duration object, that initialization shall be
47
- static. It is unspecified whether an uninitialized `atomic_flag` object
48
- has an initial state of set or clear.
49
 
50
  ``` cpp
51
  atomic_flag guard = ATOMIC_FLAG_INIT;
52
  ```
53
 
 
 
 
 
 
 
54
  ``` cpp
55
  bool atomic_flag_test_and_set(volatile atomic_flag* object) noexcept;
56
  bool atomic_flag_test_and_set(atomic_flag* object) noexcept;
57
  bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object, memory_order order) noexcept;
58
  bool atomic_flag_test_and_set_explicit(atomic_flag* object, memory_order order) noexcept;
@@ -75,11 +79,11 @@ void atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order
75
  void atomic_flag_clear_explicit(atomic_flag* object, memory_order order) noexcept;
76
  void atomic_flag::clear(memory_order order = memory_order_seq_cst) volatile noexcept;
77
  void atomic_flag::clear(memory_order order = memory_order_seq_cst) noexcept;
78
  ```
79
 
80
- *Requires:* The `order` argument shall not be `memory_order_acquire` or
81
- `memory_order_acq_rel`.
82
 
83
  *Effects:* Atomically sets the value pointed to by `object` or by `this`
84
  to false. Memory is affected according to the value of `order`.
85
 
 
41
  trivial default constructor, a deleted copy constructor, a deleted copy
42
  assignment operator, and a trivial destructor.
43
 
44
  The macro `ATOMIC_FLAG_INIT` shall be defined in such a way that it can
45
  be used to initialize an object of type `atomic_flag` to the clear
46
+ state. The macro can be used in the form:
 
 
47
 
48
  ``` cpp
49
  atomic_flag guard = ATOMIC_FLAG_INIT;
50
  ```
51
 
52
+ It is unspecified whether the macro can be used in other initialization
53
+ contexts. For a complete static-duration object, that initialization
54
+ shall be static. Unless initialized with `ATOMIC_FLAG_INIT`, it is
55
+ unspecified whether an `atomic_flag` object has an initial state of set
56
+ or clear.
57
+
58
  ``` cpp
59
  bool atomic_flag_test_and_set(volatile atomic_flag* object) noexcept;
60
  bool atomic_flag_test_and_set(atomic_flag* object) noexcept;
61
  bool atomic_flag_test_and_set_explicit(volatile atomic_flag* object, memory_order order) noexcept;
62
  bool atomic_flag_test_and_set_explicit(atomic_flag* object, memory_order order) noexcept;
 
79
  void atomic_flag_clear_explicit(atomic_flag* object, memory_order order) noexcept;
80
  void atomic_flag::clear(memory_order order = memory_order_seq_cst) volatile noexcept;
81
  void atomic_flag::clear(memory_order order = memory_order_seq_cst) noexcept;
82
  ```
83
 
84
+ *Requires:* The `order` argument shall not be `memory_order_consume`,
85
+ `memory_order_acquire`, nor `memory_order_acq_rel`.
86
 
87
  *Effects:* Atomically sets the value pointed to by `object` or by `this`
88
  to false. Memory is affected according to the value of `order`.
89