tmp/tmpkir2nkdn/{from.md → to.md}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
### Requirements for *Cpp17Lockable* types <a id="thread.req.lockable">[[thread.req.lockable]]</a>
|
| 2 |
|
| 3 |
-
####
|
| 4 |
|
| 5 |
An *execution agent* is an entity such as a thread that may perform work
|
| 6 |
in parallel with other execution agents.
|
| 7 |
|
| 8 |
[*Note 1*: Implementations or users can introduce other kinds of agents
|
|
@@ -42,13 +42,13 @@ A lock on an object `m` is said to be
|
|
| 42 |
nature of any lock ownership is not part of these
|
| 43 |
definitions. — *end note*]
|
| 44 |
|
| 45 |
#### *Cpp17BasicLockable* requirements <a id="thread.req.lockable.basic">[[thread.req.lockable.basic]]</a>
|
| 46 |
|
| 47 |
-
A type `L` meets the
|
| 48 |
-
|
| 49 |
-
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
m.lock()
|
| 53 |
```
|
| 54 |
|
|
@@ -68,14 +68,13 @@ execution agent.
|
|
| 68 |
|
| 69 |
*Throws:* Nothing.
|
| 70 |
|
| 71 |
#### *Cpp17Lockable* requirements <a id="thread.req.lockable.req">[[thread.req.lockable.req]]</a>
|
| 72 |
|
| 73 |
-
A type `L` meets the
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
type `L`).
|
| 77 |
|
| 78 |
``` cpp
|
| 79 |
m.try_lock()
|
| 80 |
```
|
| 81 |
|
|
@@ -87,16 +86,16 @@ been acquired for the current execution agent.
|
|
| 87 |
|
| 88 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 89 |
|
| 90 |
#### *Cpp17TimedLockable* requirements <a id="thread.req.lockable.timed">[[thread.req.lockable.timed]]</a>
|
| 91 |
|
| 92 |
-
A type `L` meets the
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
``` cpp
|
| 100 |
m.try_lock_for(rel_time)
|
| 101 |
```
|
| 102 |
|
|
@@ -126,14 +125,13 @@ acquired for the current execution agent.
|
|
| 126 |
|
| 127 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 128 |
|
| 129 |
#### *Cpp17SharedLockable* requirements <a id="thread.req.lockable.shared">[[thread.req.lockable.shared]]</a>
|
| 130 |
|
| 131 |
-
A type `L` meets the
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
type `L`):
|
| 135 |
|
| 136 |
``` cpp
|
| 137 |
m.lock_shared()
|
| 138 |
```
|
| 139 |
|
|
@@ -162,16 +160,16 @@ agent.
|
|
| 162 |
|
| 163 |
*Throws:* Nothing.
|
| 164 |
|
| 165 |
#### *Cpp17SharedTimedLockable* requirements <a id="thread.req.lockable.shared.timed">[[thread.req.lockable.shared.timed]]</a>
|
| 166 |
|
| 167 |
-
A type `L` meets the
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
|
| 174 |
``` cpp
|
| 175 |
m.try_lock_shared_for(rel_time)
|
| 176 |
```
|
| 177 |
|
|
|
|
| 1 |
### Requirements for *Cpp17Lockable* types <a id="thread.req.lockable">[[thread.req.lockable]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="thread.req.lockable.general">[[thread.req.lockable.general]]</a>
|
| 4 |
|
| 5 |
An *execution agent* is an entity such as a thread that may perform work
|
| 6 |
in parallel with other execution agents.
|
| 7 |
|
| 8 |
[*Note 1*: Implementations or users can introduce other kinds of agents
|
|
|
|
| 42 |
nature of any lock ownership is not part of these
|
| 43 |
definitions. — *end note*]
|
| 44 |
|
| 45 |
#### *Cpp17BasicLockable* requirements <a id="thread.req.lockable.basic">[[thread.req.lockable.basic]]</a>
|
| 46 |
|
| 47 |
+
A type `L` meets the requirements if the following expressions are
|
| 48 |
+
well-formed and have the specified semantics (`m` denotes a value of
|
| 49 |
+
type `L`).
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
m.lock()
|
| 53 |
```
|
| 54 |
|
|
|
|
| 68 |
|
| 69 |
*Throws:* Nothing.
|
| 70 |
|
| 71 |
#### *Cpp17Lockable* requirements <a id="thread.req.lockable.req">[[thread.req.lockable.req]]</a>
|
| 72 |
|
| 73 |
+
A type `L` meets the requirements if it meets the *Cpp17BasicLockable*
|
| 74 |
+
requirements and the following expressions are well-formed and have the
|
| 75 |
+
specified semantics (`m` denotes a value of type `L`).
|
|
|
|
| 76 |
|
| 77 |
``` cpp
|
| 78 |
m.try_lock()
|
| 79 |
```
|
| 80 |
|
|
|
|
| 86 |
|
| 87 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 88 |
|
| 89 |
#### *Cpp17TimedLockable* requirements <a id="thread.req.lockable.timed">[[thread.req.lockable.timed]]</a>
|
| 90 |
|
| 91 |
+
A type `L` meets the requirements if it meets the *Cpp17Lockable*
|
| 92 |
+
requirements and the following expressions are well-formed and have the
|
| 93 |
+
specified semantics (`m` denotes a value of type `L`, `rel_time` denotes
|
| 94 |
+
a value of an instantiation of `duration` [[time.duration]], and
|
| 95 |
+
`abs_time` denotes a value of an instantiation of `time_point`
|
| 96 |
+
[[time.point]]).
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
m.try_lock_for(rel_time)
|
| 100 |
```
|
| 101 |
|
|
|
|
| 125 |
|
| 126 |
*Returns:* `true` if the lock was acquired, otherwise `false`.
|
| 127 |
|
| 128 |
#### *Cpp17SharedLockable* requirements <a id="thread.req.lockable.shared">[[thread.req.lockable.shared]]</a>
|
| 129 |
|
| 130 |
+
A type `L` meets the requirements if the following expressions are
|
| 131 |
+
well-formed, have the specified semantics, and the expression
|
| 132 |
+
`m.try_lock_shared()` has type `bool` (`m` denotes a value of type `L`):
|
|
|
|
| 133 |
|
| 134 |
``` cpp
|
| 135 |
m.lock_shared()
|
| 136 |
```
|
| 137 |
|
|
|
|
| 160 |
|
| 161 |
*Throws:* Nothing.
|
| 162 |
|
| 163 |
#### *Cpp17SharedTimedLockable* requirements <a id="thread.req.lockable.shared.timed">[[thread.req.lockable.shared.timed]]</a>
|
| 164 |
|
| 165 |
+
A type `L` meets the requirements if it meets the *Cpp17SharedLockable*
|
| 166 |
+
requirements, and the following expressions are well-formed, have type
|
| 167 |
+
`bool`, and have the specified semantics (`m` denotes a value of type
|
| 168 |
+
`L`, `rel_time` denotes a value of a specialization of
|
| 169 |
+
`chrono::duration`, and `abs_time` denotes a value of a specialization
|
| 170 |
+
of `chrono::time_point`).
|
| 171 |
|
| 172 |
``` cpp
|
| 173 |
m.try_lock_shared_for(rel_time)
|
| 174 |
```
|
| 175 |
|