From Jason Turner

[thread.lock.algorithm]

Diff to HTML by rtfpessoa

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