From Jason Turner

[thread.lock.unique]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpnointchw/{from.md → to.md} +4 -12
tmp/tmpnointchw/{from.md → to.md} RENAMED
@@ -23,11 +23,11 @@ namespace std {
23
 
24
  unique_lock(const unique_lock&) = delete;
25
  unique_lock& operator=(const unique_lock&) = delete;
26
 
27
  unique_lock(unique_lock&& u) noexcept;
28
- unique_lock& operator=(unique_lock&& u);
29
 
30
  // [thread.lock.unique.locking], locking
31
  void lock();
32
  bool try_lock();
33
 
@@ -149,24 +149,16 @@ unique_lock(unique_lock&& u) noexcept;
149
  *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
150
  state of `u` just prior to this construction), `u.pm == 0` and
151
  `u.owns == false`.
152
 
153
  ``` cpp
154
- unique_lock& operator=(unique_lock&& u);
155
  ```
156
 
157
- *Effects:* If `owns` calls `pm->unlock()`.
158
 
159
- *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
160
- state of `u` just prior to this construction), `u.pm == 0` and
161
- `u.owns == false`.
162
-
163
- [*Note 1*: With a recursive mutex it is possible for both `*this` and
164
- `u` to own the same mutex before the assignment. In this case, `*this`
165
- will own the mutex after the assignment and `u` will not. — *end note*]
166
-
167
- *Throws:* Nothing.
168
 
169
  ``` cpp
170
  ~unique_lock();
171
  ```
172
 
 
23
 
24
  unique_lock(const unique_lock&) = delete;
25
  unique_lock& operator=(const unique_lock&) = delete;
26
 
27
  unique_lock(unique_lock&& u) noexcept;
28
+ unique_lock& operator=(unique_lock&& u) noexcept;
29
 
30
  // [thread.lock.unique.locking], locking
31
  void lock();
32
  bool try_lock();
33
 
 
149
  *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
150
  state of `u` just prior to this construction), `u.pm == 0` and
151
  `u.owns == false`.
152
 
153
  ``` cpp
154
+ unique_lock& operator=(unique_lock&& u) noexcept;
155
  ```
156
 
157
+ *Effects:* Equivalent to: `unique_lock(std::move(u)).swap(*this)`
158
 
159
+ *Returns:* `*this`.
 
 
 
 
 
 
 
 
160
 
161
  ``` cpp
162
  ~unique_lock();
163
  ```
164