tmp/tmpdfudelke/{from.md → to.md}
RENAMED
|
@@ -1,15 +1,29 @@
|
|
| 1 |
#### Struct `once_flag` <a id="thread.once.onceflag">[[thread.once.onceflag]]</a>
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
``` cpp
|
| 4 |
constexpr once_flag() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* Constructs an object of type `once_flag`.
|
| 8 |
|
| 9 |
*Synchronization:* The construction of a `once_flag` object is not
|
| 10 |
synchronized.
|
| 11 |
|
| 12 |
-
The object’s internal state is set to indicate to an
|
| 13 |
-
`call_once` with the object as its initial argument that
|
| 14 |
-
been called.
|
| 15 |
|
|
|
|
| 1 |
#### Struct `once_flag` <a id="thread.once.onceflag">[[thread.once.onceflag]]</a>
|
| 2 |
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
struct once_flag {
|
| 6 |
+
constexpr once_flag() noexcept;
|
| 7 |
+
|
| 8 |
+
once_flag(const once_flag&) = delete;
|
| 9 |
+
once_flag& operator=(const once_flag&) = delete;
|
| 10 |
+
};
|
| 11 |
+
}
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
The class `once_flag` is an opaque data structure that `call_once` uses
|
| 15 |
+
to initialize data without causing a data race or deadlock.
|
| 16 |
+
|
| 17 |
``` cpp
|
| 18 |
constexpr once_flag() noexcept;
|
| 19 |
```
|
| 20 |
|
| 21 |
*Effects:* Constructs an object of type `once_flag`.
|
| 22 |
|
| 23 |
*Synchronization:* The construction of a `once_flag` object is not
|
| 24 |
synchronized.
|
| 25 |
|
| 26 |
+
*Postconditions:* The object’s internal state is set to indicate to an
|
| 27 |
+
invocation of `call_once` with the object as its initial argument that
|
| 28 |
+
no function has been called.
|
| 29 |
|