tmp/tmpnu65t7qy/{from.md → to.md}
RENAMED
|
@@ -11,20 +11,20 @@ template<class Lock>
|
|
| 11 |
- When unblocked, calls `lock.lock()` (possibly blocking on the lock)
|
| 12 |
and returns.
|
| 13 |
- The function will unblock when signaled by a call to `notify_one()`, a
|
| 14 |
call to `notify_all()`, or spuriously.
|
| 15 |
|
| 16 |
-
*Remarks:* If the function fails to meet the postcondition,
|
| 17 |
-
`terminate()` is called [[except.terminate]].
|
| 18 |
-
|
| 19 |
-
[*Note 1*: This can happen if the re-locking of the mutex throws an
|
| 20 |
-
exception. — *end note*]
|
| 21 |
-
|
| 22 |
*Ensures:* `lock` is locked by the calling thread.
|
| 23 |
|
| 24 |
*Throws:* Nothing.
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
``` cpp
|
| 27 |
template<class Lock, class Predicate>
|
| 28 |
void wait(Lock& lock, Predicate pred);
|
| 29 |
```
|
| 30 |
|
|
@@ -49,24 +49,24 @@ template<class Lock, class Clock, class Duration>
|
|
| 49 |
call to `notify_all()`, expiration of the absolute
|
| 50 |
timeout [[thread.req.timing]] specified by `abs_time`, or spuriously.
|
| 51 |
- If the function exits via an exception, `lock.lock()` is called prior
|
| 52 |
to exiting the function.
|
| 53 |
|
| 54 |
-
*Remarks:* If the function fails to meet the postcondition,
|
| 55 |
-
`terminate()` is called [[except.terminate]].
|
| 56 |
-
|
| 57 |
-
[*Note 2*: This can happen if the re-locking of the mutex throws an
|
| 58 |
-
exception. — *end note*]
|
| 59 |
-
|
| 60 |
*Ensures:* `lock` is locked by the calling thread.
|
| 61 |
|
| 62 |
*Returns:* `cv_status::timeout` if the absolute
|
| 63 |
timeout [[thread.req.timing]] specified by `abs_time` expired, otherwise
|
| 64 |
`cv_status::no_timeout`.
|
| 65 |
|
| 66 |
*Throws:* Timeout-related exceptions [[thread.req.timing]].
|
| 67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
``` cpp
|
| 69 |
template<class Lock, class Rep, class Period>
|
| 70 |
cv_status wait_for(Lock& lock, const chrono::duration<Rep, Period>& rel_time);
|
| 71 |
```
|
| 72 |
|
|
@@ -74,24 +74,24 @@ template<class Lock, class Rep, class Period>
|
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
return wait_until(lock, chrono::steady_clock::now() + rel_time);
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
| 79 |
*Returns:* `cv_status::timeout` if the relative
|
| 80 |
timeout [[thread.req.timing]] specified by `rel_time` expired, otherwise
|
| 81 |
`cv_status::no_timeout`.
|
| 82 |
|
| 83 |
-
*
|
| 84 |
-
|
|
|
|
|
|
|
| 85 |
|
| 86 |
[*Note 3*: This can happen if the re-locking of the mutex throws an
|
| 87 |
exception. — *end note*]
|
| 88 |
|
| 89 |
-
*Ensures:* `lock` is locked by the calling thread.
|
| 90 |
-
|
| 91 |
-
*Throws:* Timeout-related exceptions [[thread.req.timing]].
|
| 92 |
-
|
| 93 |
``` cpp
|
| 94 |
template<class Lock, class Clock, class Duration, class Predicate>
|
| 95 |
bool wait_until(Lock& lock, const chrono::time_point<Clock, Duration>& abs_time, Predicate pred);
|
| 96 |
```
|
| 97 |
|
|
|
|
| 11 |
- When unblocked, calls `lock.lock()` (possibly blocking on the lock)
|
| 12 |
and returns.
|
| 13 |
- The function will unblock when signaled by a call to `notify_one()`, a
|
| 14 |
call to `notify_all()`, or spuriously.
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
*Ensures:* `lock` is locked by the calling thread.
|
| 17 |
|
| 18 |
*Throws:* Nothing.
|
| 19 |
|
| 20 |
+
*Remarks:* If the function fails to meet the postcondition,
|
| 21 |
+
`terminate()` is invoked [[except.terminate]].
|
| 22 |
+
|
| 23 |
+
[*Note 1*: This can happen if the re-locking of the mutex throws an
|
| 24 |
+
exception. — *end note*]
|
| 25 |
+
|
| 26 |
``` cpp
|
| 27 |
template<class Lock, class Predicate>
|
| 28 |
void wait(Lock& lock, Predicate pred);
|
| 29 |
```
|
| 30 |
|
|
|
|
| 49 |
call to `notify_all()`, expiration of the absolute
|
| 50 |
timeout [[thread.req.timing]] specified by `abs_time`, or spuriously.
|
| 51 |
- If the function exits via an exception, `lock.lock()` is called prior
|
| 52 |
to exiting the function.
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
*Ensures:* `lock` is locked by the calling thread.
|
| 55 |
|
| 56 |
*Returns:* `cv_status::timeout` if the absolute
|
| 57 |
timeout [[thread.req.timing]] specified by `abs_time` expired, otherwise
|
| 58 |
`cv_status::no_timeout`.
|
| 59 |
|
| 60 |
*Throws:* Timeout-related exceptions [[thread.req.timing]].
|
| 61 |
|
| 62 |
+
*Remarks:* If the function fails to meet the postcondition,
|
| 63 |
+
`terminate()` is invoked [[except.terminate]].
|
| 64 |
+
|
| 65 |
+
[*Note 2*: This can happen if the re-locking of the mutex throws an
|
| 66 |
+
exception. — *end note*]
|
| 67 |
+
|
| 68 |
``` cpp
|
| 69 |
template<class Lock, class Rep, class Period>
|
| 70 |
cv_status wait_for(Lock& lock, const chrono::duration<Rep, Period>& rel_time);
|
| 71 |
```
|
| 72 |
|
|
|
|
| 74 |
|
| 75 |
``` cpp
|
| 76 |
return wait_until(lock, chrono::steady_clock::now() + rel_time);
|
| 77 |
```
|
| 78 |
|
| 79 |
+
*Ensures:* `lock` is locked by the calling thread.
|
| 80 |
+
|
| 81 |
*Returns:* `cv_status::timeout` if the relative
|
| 82 |
timeout [[thread.req.timing]] specified by `rel_time` expired, otherwise
|
| 83 |
`cv_status::no_timeout`.
|
| 84 |
|
| 85 |
+
*Throws:* Timeout-related exceptions [[thread.req.timing]].
|
| 86 |
+
|
| 87 |
+
*Remarks:* If the function fails to meet the postcondition, `terminate`
|
| 88 |
+
is invoked [[except.terminate]].
|
| 89 |
|
| 90 |
[*Note 3*: This can happen if the re-locking of the mutex throws an
|
| 91 |
exception. — *end note*]
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
``` cpp
|
| 94 |
template<class Lock, class Clock, class Duration, class Predicate>
|
| 95 |
bool wait_until(Lock& lock, const chrono::time_point<Clock, Duration>& abs_time, Predicate pred);
|
| 96 |
```
|
| 97 |
|