tmp/tmpw_d0d236/{from.md → to.md}
RENAMED
|
@@ -3,36 +3,43 @@
|
|
| 3 |
``` cpp
|
| 4 |
template <class L1, class L2, class... L3> int try_lock(L1&, L2&, L3&...);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Requires:* Each template parameter type shall meet the `Lockable`
|
| 8 |
-
requirements.
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
|
| 11 |
*Effects:* Calls `try_lock()` for each argument in order beginning with
|
| 12 |
the first until all arguments have been processed or a call to
|
| 13 |
`try_lock()` fails, either by returning `false` or by throwing an
|
| 14 |
exception. If a call to `try_lock()` fails, `unlock()` shall be called
|
| 15 |
for all prior arguments and there shall be no further calls to
|
| 16 |
`try_lock()`.
|
| 17 |
|
| 18 |
*Returns:* `-1` if all calls to `try_lock()` returned `true`, otherwise
|
| 19 |
-
a
|
| 20 |
-
returned `false`.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template <class L1, class L2, class... L3> void lock(L1&, L2&, L3&...);
|
| 24 |
```
|
| 25 |
|
| 26 |
*Requires:* Each template parameter type shall meet the `Lockable`
|
| 27 |
-
requirements,
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
*Effects:* All arguments are locked via a sequence of calls to `lock()`,
|
| 31 |
`try_lock()`, or `unlock()` on each argument. The sequence of calls
|
| 32 |
-
shall not result in deadlock, but is otherwise unspecified.
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
| 38 |
|
|
|
|
| 3 |
``` cpp
|
| 4 |
template <class L1, class L2, class... L3> int try_lock(L1&, L2&, L3&...);
|
| 5 |
```
|
| 6 |
|
| 7 |
*Requires:* Each template parameter type shall meet the `Lockable`
|
| 8 |
+
requirements.
|
| 9 |
+
|
| 10 |
+
[*Note 1*: The `unique_lock` class template meets these requirements
|
| 11 |
+
when suitably instantiated. — *end note*]
|
| 12 |
|
| 13 |
*Effects:* Calls `try_lock()` for each argument in order beginning with
|
| 14 |
the first until all arguments have been processed or a call to
|
| 15 |
`try_lock()` fails, either by returning `false` or by throwing an
|
| 16 |
exception. If a call to `try_lock()` fails, `unlock()` shall be called
|
| 17 |
for all prior arguments and there shall be no further calls to
|
| 18 |
`try_lock()`.
|
| 19 |
|
| 20 |
*Returns:* `-1` if all calls to `try_lock()` returned `true`, otherwise
|
| 21 |
+
a zero-based index value that indicates the argument for which
|
| 22 |
+
`try_lock()` returned `false`.
|
| 23 |
|
| 24 |
``` cpp
|
| 25 |
template <class L1, class L2, class... L3> void lock(L1&, L2&, L3&...);
|
| 26 |
```
|
| 27 |
|
| 28 |
*Requires:* Each template parameter type shall meet the `Lockable`
|
| 29 |
+
requirements,
|
| 30 |
+
|
| 31 |
+
[*Note 2*: The `unique_lock` class template meets these requirements
|
| 32 |
+
when suitably instantiated. — *end note*]
|
| 33 |
|
| 34 |
*Effects:* All arguments are locked via a sequence of calls to `lock()`,
|
| 35 |
`try_lock()`, or `unlock()` on each argument. The sequence of calls
|
| 36 |
+
shall not result in deadlock, but is otherwise unspecified.
|
| 37 |
+
|
| 38 |
+
[*Note 3*: A deadlock avoidance algorithm such as try-and-back-off must
|
| 39 |
+
be used, but the specific algorithm is not specified to avoid
|
| 40 |
+
over-constraining implementations. — *end note*]
|
| 41 |
+
|
| 42 |
+
If a call to `lock()` or `try_lock()` throws an exception, `unlock()`
|
| 43 |
+
shall be called for any argument that had been locked by a call to
|
| 44 |
+
`lock()` or `try_lock()`.
|
| 45 |
|