tmp/tmpjcuua60o/{from.md → to.md}
RENAMED
|
@@ -1,87 +1,77 @@
|
|
| 1 |
-
#####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
shared_lock() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
-
*
|
| 8 |
-
|
| 9 |
-
*Postconditions:* `pm == nullptr` and `owns == false`.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
explicit shared_lock(mutex_type& m);
|
| 13 |
```
|
| 14 |
|
| 15 |
-
*
|
| 16 |
-
mode.
|
| 17 |
|
| 18 |
-
*Effects:*
|
| 19 |
-
`m.lock_shared()`.
|
| 20 |
|
| 21 |
-
*
|
| 22 |
|
| 23 |
``` cpp
|
| 24 |
shared_lock(mutex_type& m, defer_lock_t) noexcept;
|
| 25 |
```
|
| 26 |
|
| 27 |
-
*
|
| 28 |
-
|
| 29 |
-
*Postconditions:* `pm == addressof(m)` and `owns == false`.
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
shared_lock(mutex_type& m, try_to_lock_t);
|
| 33 |
```
|
| 34 |
|
| 35 |
-
*
|
| 36 |
-
mode.
|
| 37 |
|
| 38 |
-
*Effects:*
|
| 39 |
-
`m.try_lock_shared()`.
|
| 40 |
|
| 41 |
-
*
|
| 42 |
-
|
| 43 |
|
| 44 |
``` cpp
|
| 45 |
shared_lock(mutex_type& m, adopt_lock_t);
|
| 46 |
```
|
| 47 |
|
| 48 |
-
*
|
| 49 |
|
| 50 |
-
*
|
| 51 |
-
|
| 52 |
-
*Postconditions:* `pm == addressof(m)` and `owns == true`.
|
| 53 |
|
| 54 |
``` cpp
|
| 55 |
template<class Clock, class Duration>
|
| 56 |
shared_lock(mutex_type& m,
|
| 57 |
const chrono::time_point<Clock, Duration>& abs_time);
|
| 58 |
```
|
| 59 |
|
| 60 |
-
*
|
| 61 |
-
mode.
|
| 62 |
|
| 63 |
-
*Effects:*
|
| 64 |
-
`m.try_lock_shared_until(abs_time)`.
|
| 65 |
|
| 66 |
-
*
|
| 67 |
-
|
| 68 |
|
| 69 |
``` cpp
|
| 70 |
template<class Rep, class Period>
|
| 71 |
shared_lock(mutex_type& m,
|
| 72 |
const chrono::duration<Rep, Period>& rel_time);
|
| 73 |
```
|
| 74 |
|
| 75 |
-
*
|
| 76 |
-
mode.
|
| 77 |
|
| 78 |
-
*Effects:*
|
| 79 |
-
`m.try_lock_shared_for(rel_time)`.
|
| 80 |
|
| 81 |
-
*
|
| 82 |
-
|
| 83 |
|
| 84 |
``` cpp
|
| 85 |
~shared_lock();
|
| 86 |
```
|
| 87 |
|
|
@@ -89,19 +79,19 @@ the value returned by the call to `m.try_lock_shared_for(rel_time)`.
|
|
| 89 |
|
| 90 |
``` cpp
|
| 91 |
shared_lock(shared_lock&& sl) noexcept;
|
| 92 |
```
|
| 93 |
|
| 94 |
-
*
|
| 95 |
-
|
| 96 |
-
`sl.
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
shared_lock& operator=(shared_lock&& sl) noexcept;
|
| 100 |
```
|
| 101 |
|
| 102 |
*Effects:* If `owns` calls `pm->unlock_shared()`.
|
| 103 |
|
| 104 |
-
*
|
| 105 |
-
|
| 106 |
-
|
| 107 |
|
|
|
|
| 1 |
+
##### Constructors, destructor, and assignment <a id="thread.lock.shared.cons">[[thread.lock.shared.cons]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
shared_lock() noexcept;
|
| 5 |
```
|
| 6 |
|
| 7 |
+
*Ensures:* `pm == nullptr` and `owns == false`.
|
|
|
|
|
|
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
explicit shared_lock(mutex_type& m);
|
| 11 |
```
|
| 12 |
|
| 13 |
+
*Preconditions:* The calling thread does not own the mutex for any
|
| 14 |
+
ownership mode.
|
| 15 |
|
| 16 |
+
*Effects:* Calls `m.lock_shared()`.
|
|
|
|
| 17 |
|
| 18 |
+
*Ensures:* `pm == addressof(m)` and `owns == true`.
|
| 19 |
|
| 20 |
``` cpp
|
| 21 |
shared_lock(mutex_type& m, defer_lock_t) noexcept;
|
| 22 |
```
|
| 23 |
|
| 24 |
+
*Ensures:* `pm == addressof(m)` and `owns == false`.
|
|
|
|
|
|
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
shared_lock(mutex_type& m, try_to_lock_t);
|
| 28 |
```
|
| 29 |
|
| 30 |
+
*Preconditions:* The calling thread does not own the mutex for any
|
| 31 |
+
ownership mode.
|
| 32 |
|
| 33 |
+
*Effects:* Calls `m.try_lock_shared()`.
|
|
|
|
| 34 |
|
| 35 |
+
*Ensures:* `pm == addressof(m)` and `owns == res` where `res` is the
|
| 36 |
+
value returned by the call to `m.try_lock_shared()`.
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
shared_lock(mutex_type& m, adopt_lock_t);
|
| 40 |
```
|
| 41 |
|
| 42 |
+
*Preconditions:* The calling thread has shared ownership of the mutex.
|
| 43 |
|
| 44 |
+
*Ensures:* `pm == addressof(m)` and `owns == true`.
|
|
|
|
|
|
|
| 45 |
|
| 46 |
``` cpp
|
| 47 |
template<class Clock, class Duration>
|
| 48 |
shared_lock(mutex_type& m,
|
| 49 |
const chrono::time_point<Clock, Duration>& abs_time);
|
| 50 |
```
|
| 51 |
|
| 52 |
+
*Preconditions:* The calling thread does not own the mutex for any
|
| 53 |
+
ownership mode.
|
| 54 |
|
| 55 |
+
*Effects:* Calls `m.try_lock_shared_until(abs_time)`.
|
|
|
|
| 56 |
|
| 57 |
+
*Ensures:* `pm == addressof(m)` and `owns == res` where `res` is the
|
| 58 |
+
value returned by the call to `m.try_lock_shared_until(abs_time)`.
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
template<class Rep, class Period>
|
| 62 |
shared_lock(mutex_type& m,
|
| 63 |
const chrono::duration<Rep, Period>& rel_time);
|
| 64 |
```
|
| 65 |
|
| 66 |
+
*Preconditions:* The calling thread does not own the mutex for any
|
| 67 |
+
ownership mode.
|
| 68 |
|
| 69 |
+
*Effects:* Calls `m.try_lock_shared_for(rel_time)`.
|
|
|
|
| 70 |
|
| 71 |
+
*Ensures:* `pm == addressof(m)` and `owns == res` where `res` is the
|
| 72 |
+
value returned by the call to `m.try_lock_shared_for(rel_time)`.
|
| 73 |
|
| 74 |
``` cpp
|
| 75 |
~shared_lock();
|
| 76 |
```
|
| 77 |
|
|
|
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
shared_lock(shared_lock&& sl) noexcept;
|
| 82 |
```
|
| 83 |
|
| 84 |
+
*Ensures:* `pm == sl_p.pm` and `owns == sl_p.owns` (where `sl_p` is the
|
| 85 |
+
state of `sl` just prior to this construction), `sl.pm == nullptr` and
|
| 86 |
+
`sl.owns == false`.
|
| 87 |
|
| 88 |
``` cpp
|
| 89 |
shared_lock& operator=(shared_lock&& sl) noexcept;
|
| 90 |
```
|
| 91 |
|
| 92 |
*Effects:* If `owns` calls `pm->unlock_shared()`.
|
| 93 |
|
| 94 |
+
*Ensures:* `pm == sl_p.pm` and `owns == sl_p.owns` (where `sl_p` is the
|
| 95 |
+
state of `sl` just prior to this assignment), `sl.pm == nullptr` and
|
| 96 |
+
`sl.owns == false`.
|
| 97 |
|