tmp/tmpt02zq606/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
#####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
void lock();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* As if by `pm->lock_shared()`.
|
| 8 |
|
| 9 |
-
*
|
| 10 |
|
| 11 |
*Throws:* Any exception thrown by `pm->lock_shared()`. `system_error`
|
| 12 |
-
when an exception is required
|
| 13 |
|
| 14 |
*Error conditions:*
|
| 15 |
|
| 16 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 17 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
@@ -22,39 +22,36 @@ bool try_lock();
|
|
| 22 |
|
| 23 |
*Effects:* As if by `pm->try_lock_shared()`.
|
| 24 |
|
| 25 |
*Returns:* The value returned by the call to `pm->try_lock_shared()`.
|
| 26 |
|
| 27 |
-
*
|
| 28 |
-
|
| 29 |
|
| 30 |
*Throws:* Any exception thrown by `pm->try_lock_shared()`.
|
| 31 |
-
`system_error` when an exception is
|
| 32 |
-
required ([[thread.req.exception]]).
|
| 33 |
|
| 34 |
*Error conditions:*
|
| 35 |
|
| 36 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 37 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
template<class Clock, class Duration>
|
| 41 |
-
bool
|
| 42 |
-
try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
|
| 43 |
```
|
| 44 |
|
| 45 |
*Effects:* As if by `pm->try_lock_shared_until(abs_time)`.
|
| 46 |
|
| 47 |
*Returns:* The value returned by the call to
|
| 48 |
`pm->try_lock_shared_until(abs_time)`.
|
| 49 |
|
| 50 |
-
*
|
| 51 |
-
|
| 52 |
|
| 53 |
*Throws:* Any exception thrown by `pm->try_lock_shared_until(abs_time)`.
|
| 54 |
-
`system_error` when an exception is
|
| 55 |
-
required ([[thread.req.exception]]).
|
| 56 |
|
| 57 |
*Error conditions:*
|
| 58 |
|
| 59 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 60 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
@@ -67,16 +64,15 @@ template <class Rep, class Period>
|
|
| 67 |
*Effects:* As if by `pm->try_lock_shared_for(rel_time)`.
|
| 68 |
|
| 69 |
*Returns:* The value returned by the call to
|
| 70 |
`pm->try_lock_shared_for(rel_time)`.
|
| 71 |
|
| 72 |
-
*
|
| 73 |
-
|
| 74 |
|
| 75 |
*Throws:* Any exception thrown by `pm->try_lock_shared_for(rel_time)`.
|
| 76 |
-
`system_error` when an exception is
|
| 77 |
-
required ([[thread.req.exception]]).
|
| 78 |
|
| 79 |
*Error conditions:*
|
| 80 |
|
| 81 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 82 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
@@ -85,14 +81,14 @@ required ([[thread.req.exception]]).
|
|
| 85 |
void unlock();
|
| 86 |
```
|
| 87 |
|
| 88 |
*Effects:* As if by `pm->unlock_shared()`.
|
| 89 |
|
| 90 |
-
*
|
| 91 |
|
| 92 |
*Throws:* `system_error` when an exception is
|
| 93 |
-
required
|
| 94 |
|
| 95 |
*Error conditions:*
|
| 96 |
|
| 97 |
- `operation_not_permitted` — if on entry `owns` is `false`.
|
| 98 |
|
|
|
|
| 1 |
+
##### Locking <a id="thread.lock.shared.locking">[[thread.lock.shared.locking]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
void lock();
|
| 5 |
```
|
| 6 |
|
| 7 |
*Effects:* As if by `pm->lock_shared()`.
|
| 8 |
|
| 9 |
+
*Ensures:* `owns == true`.
|
| 10 |
|
| 11 |
*Throws:* Any exception thrown by `pm->lock_shared()`. `system_error`
|
| 12 |
+
when an exception is required [[thread.req.exception]].
|
| 13 |
|
| 14 |
*Error conditions:*
|
| 15 |
|
| 16 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 17 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
|
|
| 22 |
|
| 23 |
*Effects:* As if by `pm->try_lock_shared()`.
|
| 24 |
|
| 25 |
*Returns:* The value returned by the call to `pm->try_lock_shared()`.
|
| 26 |
|
| 27 |
+
*Ensures:* `owns == res`, where `res` is the value returned by the call
|
| 28 |
+
to `pm->try_lock_shared()`.
|
| 29 |
|
| 30 |
*Throws:* Any exception thrown by `pm->try_lock_shared()`.
|
| 31 |
+
`system_error` when an exception is required [[thread.req.exception]].
|
|
|
|
| 32 |
|
| 33 |
*Error conditions:*
|
| 34 |
|
| 35 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 36 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
template<class Clock, class Duration>
|
| 40 |
+
bool try_lock_until(const chrono::time_point<Clock, Duration>& abs_time);
|
|
|
|
| 41 |
```
|
| 42 |
|
| 43 |
*Effects:* As if by `pm->try_lock_shared_until(abs_time)`.
|
| 44 |
|
| 45 |
*Returns:* The value returned by the call to
|
| 46 |
`pm->try_lock_shared_until(abs_time)`.
|
| 47 |
|
| 48 |
+
*Ensures:* `owns == res`, where `res` is the value returned by the call
|
| 49 |
+
to `pm->try_lock_shared_until(abs_time)`.
|
| 50 |
|
| 51 |
*Throws:* Any exception thrown by `pm->try_lock_shared_until(abs_time)`.
|
| 52 |
+
`system_error` when an exception is required [[thread.req.exception]].
|
|
|
|
| 53 |
|
| 54 |
*Error conditions:*
|
| 55 |
|
| 56 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 57 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
|
|
| 64 |
*Effects:* As if by `pm->try_lock_shared_for(rel_time)`.
|
| 65 |
|
| 66 |
*Returns:* The value returned by the call to
|
| 67 |
`pm->try_lock_shared_for(rel_time)`.
|
| 68 |
|
| 69 |
+
*Ensures:* `owns == res`, where `res` is the value returned by the call
|
| 70 |
+
to `pm->try_lock_shared_for(rel_time)`.
|
| 71 |
|
| 72 |
*Throws:* Any exception thrown by `pm->try_lock_shared_for(rel_time)`.
|
| 73 |
+
`system_error` when an exception is required [[thread.req.exception]].
|
|
|
|
| 74 |
|
| 75 |
*Error conditions:*
|
| 76 |
|
| 77 |
- `operation_not_permitted` — if `pm` is `nullptr`.
|
| 78 |
- `resource_deadlock_would_occur` — if on entry `owns` is `true`.
|
|
|
|
| 81 |
void unlock();
|
| 82 |
```
|
| 83 |
|
| 84 |
*Effects:* As if by `pm->unlock_shared()`.
|
| 85 |
|
| 86 |
+
*Ensures:* `owns == false`.
|
| 87 |
|
| 88 |
*Throws:* `system_error` when an exception is
|
| 89 |
+
required [[thread.req.exception]].
|
| 90 |
|
| 91 |
*Error conditions:*
|
| 92 |
|
| 93 |
- `operation_not_permitted` — if on entry `owns` is `false`.
|
| 94 |
|