From Jason Turner

[thread.lock]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpo12g25qk/{from.md → to.md} +6 -16
tmp/tmpo12g25qk/{from.md → to.md} RENAMED
@@ -172,11 +172,11 @@ namespace std {
172
 
173
  unique_lock(const unique_lock&) = delete;
174
  unique_lock& operator=(const unique_lock&) = delete;
175
 
176
  unique_lock(unique_lock&& u) noexcept;
177
- unique_lock& operator=(unique_lock&& u);
178
 
179
  // [thread.lock.unique.locking], locking
180
  void lock();
181
  bool try_lock();
182
 
@@ -298,24 +298,16 @@ unique_lock(unique_lock&& u) noexcept;
298
  *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
299
  state of `u` just prior to this construction), `u.pm == 0` and
300
  `u.owns == false`.
301
 
302
  ``` cpp
303
- unique_lock& operator=(unique_lock&& u);
304
  ```
305
 
306
- *Effects:* If `owns` calls `pm->unlock()`.
307
 
308
- *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
309
- state of `u` just prior to this construction), `u.pm == 0` and
310
- `u.owns == false`.
311
-
312
- [*Note 1*: With a recursive mutex it is possible for both `*this` and
313
- `u` to own the same mutex before the assignment. In this case, `*this`
314
- will own the mutex after the assignment and `u` will not. — *end note*]
315
-
316
- *Throws:* Nothing.
317
 
318
  ``` cpp
319
  ~unique_lock();
320
  ```
321
 
@@ -620,15 +612,13 @@ state of `sl` just prior to this construction), `sl.pm == nullptr` and
620
 
621
  ``` cpp
622
  shared_lock& operator=(shared_lock&& sl) noexcept;
623
  ```
624
 
625
- *Effects:* If `owns` calls `pm->unlock_shared()`.
626
 
627
- *Ensures:* `pm == sl_p.pm` and `owns == sl_p.owns` (where `sl_p` is the
628
- state of `sl` just prior to this assignment), `sl.pm == nullptr` and
629
- `sl.owns == false`.
630
 
631
  ##### Locking <a id="thread.lock.shared.locking">[[thread.lock.shared.locking]]</a>
632
 
633
  ``` cpp
634
  void lock();
 
172
 
173
  unique_lock(const unique_lock&) = delete;
174
  unique_lock& operator=(const unique_lock&) = delete;
175
 
176
  unique_lock(unique_lock&& u) noexcept;
177
+ unique_lock& operator=(unique_lock&& u) noexcept;
178
 
179
  // [thread.lock.unique.locking], locking
180
  void lock();
181
  bool try_lock();
182
 
 
298
  *Ensures:* `pm == u_p.pm` and `owns == u_p.owns` (where `u_p` is the
299
  state of `u` just prior to this construction), `u.pm == 0` and
300
  `u.owns == false`.
301
 
302
  ``` cpp
303
+ unique_lock& operator=(unique_lock&& u) noexcept;
304
  ```
305
 
306
+ *Effects:* Equivalent to: `unique_lock(std::move(u)).swap(*this)`
307
 
308
+ *Returns:* `*this`.
 
 
 
 
 
 
 
 
309
 
310
  ``` cpp
311
  ~unique_lock();
312
  ```
313
 
 
612
 
613
  ``` cpp
614
  shared_lock& operator=(shared_lock&& sl) noexcept;
615
  ```
616
 
617
+ *Effects:* Equivalent to: `shared_lock(std::move(sl)).swap(*this)`
618
 
619
+ *Returns:* `*this`.
 
 
620
 
621
  ##### Locking <a id="thread.lock.shared.locking">[[thread.lock.shared.locking]]</a>
622
 
623
  ``` cpp
624
  void lock();