From Jason Turner

[thread.lock.unique.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpm40008k5/{from.md → to.md} +5 -11
tmp/tmpm40008k5/{from.md → to.md} RENAMED
@@ -2,19 +2,16 @@
2
 
3
  ``` cpp
4
  unique_lock() noexcept;
5
  ```
6
 
7
- *Ensures:* `pm == 0` and `owns == false`.
8
 
9
  ``` cpp
10
  explicit unique_lock(mutex_type& m);
11
  ```
12
 
13
- *Preconditions:* If `mutex_type` is not a recursive mutex the calling
14
- thread does not own the mutex.
15
-
16
  *Effects:* Calls `m.lock()`.
17
 
18
  *Ensures:* `pm == addressof(m)` and `owns == true`.
19
 
20
  ``` cpp
@@ -26,35 +23,33 @@ unique_lock(mutex_type& m, defer_lock_t) noexcept;
26
  ``` cpp
27
  unique_lock(mutex_type& m, try_to_lock_t);
28
  ```
29
 
30
  *Preconditions:* The supplied `Mutex` type meets the *Cpp17Lockable*
31
- requirements [[thread.req.lockable.req]]. If `mutex_type` is not a
32
- recursive mutex the calling thread does not own the mutex.
33
 
34
  *Effects:* Calls `m.try_lock()`.
35
 
36
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the
37
  value returned by the call to `m.try_lock()`.
38
 
39
  ``` cpp
40
  unique_lock(mutex_type& m, adopt_lock_t);
41
  ```
42
 
43
- *Preconditions:* The calling thread owns the mutex.
44
 
45
  *Ensures:* `pm == addressof(m)` and `owns == true`.
46
 
47
  *Throws:* Nothing.
48
 
49
  ``` cpp
50
  template<class Clock, class Duration>
51
  unique_lock(mutex_type& m, const chrono::time_point<Clock, Duration>& abs_time);
52
  ```
53
 
54
- *Preconditions:* If `mutex_type` is not a recursive mutex the calling
55
- thread does not own the mutex. The supplied `Mutex` type meets the
56
  *Cpp17TimedLockable* requirements [[thread.req.lockable.timed]].
57
 
58
  *Effects:* Calls `m.try_lock_until(abs_time)`.
59
 
60
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the
@@ -63,12 +58,11 @@ value returned by the call to `m.try_lock_until(abs_time)`.
63
  ``` cpp
64
  template<class Rep, class Period>
65
  unique_lock(mutex_type& m, const chrono::duration<Rep, Period>& rel_time);
66
  ```
67
 
68
- *Preconditions:* If `mutex_type` is not a recursive mutex the calling
69
- thread does not own the mutex. The supplied `Mutex` type meets the
70
  *Cpp17TimedLockable* requirements [[thread.req.lockable.timed]].
71
 
72
  *Effects:* Calls `m.try_lock_for(rel_time)`.
73
 
74
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the
 
2
 
3
  ``` cpp
4
  unique_lock() noexcept;
5
  ```
6
 
7
+ *Ensures:* `pm == nullptr` and `owns == false`.
8
 
9
  ``` cpp
10
  explicit unique_lock(mutex_type& m);
11
  ```
12
 
 
 
 
13
  *Effects:* Calls `m.lock()`.
14
 
15
  *Ensures:* `pm == addressof(m)` and `owns == true`.
16
 
17
  ``` cpp
 
23
  ``` cpp
24
  unique_lock(mutex_type& m, try_to_lock_t);
25
  ```
26
 
27
  *Preconditions:* The supplied `Mutex` type meets the *Cpp17Lockable*
28
+ requirements [[thread.req.lockable.req]].
 
29
 
30
  *Effects:* Calls `m.try_lock()`.
31
 
32
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the
33
  value returned by the call to `m.try_lock()`.
34
 
35
  ``` cpp
36
  unique_lock(mutex_type& m, adopt_lock_t);
37
  ```
38
 
39
+ *Preconditions:* The calling thread holds a non-shared lock on `m`.
40
 
41
  *Ensures:* `pm == addressof(m)` and `owns == true`.
42
 
43
  *Throws:* Nothing.
44
 
45
  ``` cpp
46
  template<class Clock, class Duration>
47
  unique_lock(mutex_type& m, const chrono::time_point<Clock, Duration>& abs_time);
48
  ```
49
 
50
+ *Preconditions:* The supplied `Mutex` type meets the
 
51
  *Cpp17TimedLockable* requirements [[thread.req.lockable.timed]].
52
 
53
  *Effects:* Calls `m.try_lock_until(abs_time)`.
54
 
55
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the
 
58
  ``` cpp
59
  template<class Rep, class Period>
60
  unique_lock(mutex_type& m, const chrono::duration<Rep, Period>& rel_time);
61
  ```
62
 
63
+ *Preconditions:* The supplied `Mutex` type meets the
 
64
  *Cpp17TimedLockable* requirements [[thread.req.lockable.timed]].
65
 
66
  *Effects:* Calls `m.try_lock_for(rel_time)`.
67
 
68
  *Ensures:* `pm == addressof(m)` and `owns == res`, where `res` is the