tmp/tmpz3m_glky/{from.md → to.md}
RENAMED
|
@@ -120,11 +120,11 @@ exceptions*.
|
|
| 120 |
supplied by the implementation as specified in [[time.clock]] do not
|
| 121 |
throw exceptions. — *end note*]
|
| 122 |
|
| 123 |
### Requirements for *Cpp17Lockable* types <a id="thread.req.lockable">[[thread.req.lockable]]</a>
|
| 124 |
|
| 125 |
-
####
|
| 126 |
|
| 127 |
An *execution agent* is an entity such as a thread that may perform work
|
| 128 |
in parallel with other execution agents.
|
| 129 |
|
| 130 |
[*Note 1*: Implementations or users can introduce other kinds of agents
|
|
@@ -164,13 +164,13 @@ A lock on an object `m` is said to be
|
|
| 164 |
nature of any lock ownership is not part of these
|
| 165 |
definitions. — *end note*]
|
| 166 |
|
| 167 |
#### *Cpp17BasicLockable* requirements <a id="thread.req.lockable.basic">[[thread.req.lockable.basic]]</a>
|
| 168 |
|
| 169 |
-
A type `L` meets the
|
| 170 |
-
|
| 171 |
-
|
| 172 |
|
| 173 |
``` cpp
|
| 174 |
m.lock()
|
| 175 |
```
|
| 176 |
|
|
@@ -190,14 +190,13 @@ execution agent.
|
|
| 190 |
|
| 191 |
*Throws:* Nothing.
|
| 192 |
|
| 193 |
#### *Cpp17Lockable* requirements <a id="thread.req.lockable.req">[[thread.req.lockable.req]]</a>
|
| 194 |
|
| 195 |
-
A type `L` meets the
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
type `L`).
|
| 199 |
|
| 200 |
``` cpp
|
| 201 |
m.try_lock()
|
| 202 |
```
|
| 203 |
|
|
@@ -209,16 +208,16 @@ been acquired for the current execution agent.
|
|
| 209 |
|
| 210 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 211 |
|
| 212 |
#### *Cpp17TimedLockable* requirements <a id="thread.req.lockable.timed">[[thread.req.lockable.timed]]</a>
|
| 213 |
|
| 214 |
-
A type `L` meets the
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
|
| 221 |
``` cpp
|
| 222 |
m.try_lock_for(rel_time)
|
| 223 |
```
|
| 224 |
|
|
@@ -248,14 +247,13 @@ acquired for the current execution agent.
|
|
| 248 |
|
| 249 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 250 |
|
| 251 |
#### *Cpp17SharedLockable* requirements <a id="thread.req.lockable.shared">[[thread.req.lockable.shared]]</a>
|
| 252 |
|
| 253 |
-
A type `L` meets the
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
type `L`):
|
| 257 |
|
| 258 |
``` cpp
|
| 259 |
m.lock_shared()
|
| 260 |
```
|
| 261 |
|
|
@@ -284,16 +282,16 @@ agent.
|
|
| 284 |
|
| 285 |
*Throws:* Nothing.
|
| 286 |
|
| 287 |
#### *Cpp17SharedTimedLockable* requirements <a id="thread.req.lockable.shared.timed">[[thread.req.lockable.shared.timed]]</a>
|
| 288 |
|
| 289 |
-
A type `L` meets the
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
|
| 296 |
``` cpp
|
| 297 |
m.try_lock_shared_for(rel_time)
|
| 298 |
```
|
| 299 |
|
|
|
|
| 120 |
supplied by the implementation as specified in [[time.clock]] do not
|
| 121 |
throw exceptions. — *end note*]
|
| 122 |
|
| 123 |
### Requirements for *Cpp17Lockable* types <a id="thread.req.lockable">[[thread.req.lockable]]</a>
|
| 124 |
|
| 125 |
+
#### General <a id="thread.req.lockable.general">[[thread.req.lockable.general]]</a>
|
| 126 |
|
| 127 |
An *execution agent* is an entity such as a thread that may perform work
|
| 128 |
in parallel with other execution agents.
|
| 129 |
|
| 130 |
[*Note 1*: Implementations or users can introduce other kinds of agents
|
|
|
|
| 164 |
nature of any lock ownership is not part of these
|
| 165 |
definitions. — *end note*]
|
| 166 |
|
| 167 |
#### *Cpp17BasicLockable* requirements <a id="thread.req.lockable.basic">[[thread.req.lockable.basic]]</a>
|
| 168 |
|
| 169 |
+
A type `L` meets the requirements if the following expressions are
|
| 170 |
+
well-formed and have the specified semantics (`m` denotes a value of
|
| 171 |
+
type `L`).
|
| 172 |
|
| 173 |
``` cpp
|
| 174 |
m.lock()
|
| 175 |
```
|
| 176 |
|
|
|
|
| 190 |
|
| 191 |
*Throws:* Nothing.
|
| 192 |
|
| 193 |
#### *Cpp17Lockable* requirements <a id="thread.req.lockable.req">[[thread.req.lockable.req]]</a>
|
| 194 |
|
| 195 |
+
A type `L` meets the requirements if it meets the *Cpp17BasicLockable*
|
| 196 |
+
requirements and the following expressions are well-formed and have the
|
| 197 |
+
specified semantics (`m` denotes a value of type `L`).
|
|
|
|
| 198 |
|
| 199 |
``` cpp
|
| 200 |
m.try_lock()
|
| 201 |
```
|
| 202 |
|
|
|
|
| 208 |
|
| 209 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 210 |
|
| 211 |
#### *Cpp17TimedLockable* requirements <a id="thread.req.lockable.timed">[[thread.req.lockable.timed]]</a>
|
| 212 |
|
| 213 |
+
A type `L` meets the requirements if it meets the *Cpp17Lockable*
|
| 214 |
+
requirements and the following expressions are well-formed and have the
|
| 215 |
+
specified semantics (`m` denotes a value of type `L`, `rel_time` denotes
|
| 216 |
+
a value of an instantiation of `duration` [[time.duration]], and
|
| 217 |
+
`abs_time` denotes a value of an instantiation of `time_point`
|
| 218 |
+
[[time.point]]).
|
| 219 |
|
| 220 |
``` cpp
|
| 221 |
m.try_lock_for(rel_time)
|
| 222 |
```
|
| 223 |
|
|
|
|
| 247 |
|
| 248 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 249 |
|
| 250 |
#### *Cpp17SharedLockable* requirements <a id="thread.req.lockable.shared">[[thread.req.lockable.shared]]</a>
|
| 251 |
|
| 252 |
+
A type `L` meets the requirements if the following expressions are
|
| 253 |
+
well-formed, have the specified semantics, and the expression
|
| 254 |
+
`m.try_lock_shared()` has type `bool` (`m` denotes a value of type `L`):
|
|
|
|
| 255 |
|
| 256 |
``` cpp
|
| 257 |
m.lock_shared()
|
| 258 |
```
|
| 259 |
|
|
|
|
| 282 |
|
| 283 |
*Throws:* Nothing.
|
| 284 |
|
| 285 |
#### *Cpp17SharedTimedLockable* requirements <a id="thread.req.lockable.shared.timed">[[thread.req.lockable.shared.timed]]</a>
|
| 286 |
|
| 287 |
+
A type `L` meets the requirements if it meets the *Cpp17SharedLockable*
|
| 288 |
+
requirements, and the following expressions are well-formed, have type
|
| 289 |
+
`bool`, and have the specified semantics (`m` denotes a value of type
|
| 290 |
+
`L`, `rel_time` denotes a value of a specialization of
|
| 291 |
+
`chrono::duration`, and `abs_time` denotes a value of a specialization
|
| 292 |
+
of `chrono::time_point`).
|
| 293 |
|
| 294 |
``` cpp
|
| 295 |
m.try_lock_shared_for(rel_time)
|
| 296 |
```
|
| 297 |
|