tmp/tmp6utmlt0t/{from.md → to.md}
RENAMED
|
@@ -1,18 +1,20 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
The behavior of a program is undefined if calls to standard library
|
| 4 |
functions from different threads may introduce a data race. The
|
| 5 |
conditions under which this may occur are specified in
|
| 6 |
-
[[res.on.data.races]].
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
|
|
|
|
| 1 |
+
#### Library object access <a id="res.on.objects">[[res.on.objects]]</a>
|
| 2 |
|
| 3 |
The behavior of a program is undefined if calls to standard library
|
| 4 |
functions from different threads may introduce a data race. The
|
| 5 |
conditions under which this may occur are specified in
|
| 6 |
+
[[res.on.data.races]].
|
| 7 |
+
|
| 8 |
+
[*Note 1*: Modifying an object of a standard library type that is
|
| 9 |
+
shared between threads risks undefined behavior unless objects of that
|
| 10 |
+
type are explicitly specified as being sharable without data races or
|
| 11 |
+
the user supplies a locking mechanism. — *end note*]
|
| 12 |
+
|
| 13 |
+
If an object of a standard library type is accessed, and the beginning
|
| 14 |
+
of the object’s lifetime ([[basic.life]]) does not happen before the
|
| 15 |
+
access, or the access does not happen before the end of the object’s
|
| 16 |
+
lifetime, the behavior is undefined unless otherwise specified.
|
| 17 |
+
|
| 18 |
+
[*Note 2*: This applies even to objects such as mutexes intended for
|
| 19 |
+
thread synchronization. — *end note*]
|
| 20 |
|