tmp/tmpsihakfnh/{from.md → to.md}
RENAMED
|
@@ -1,45 +1,29 @@
|
|
| 1 |
#### Constructors and destructor <a id="stopcallback.cons">[[stopcallback.cons]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
template<class
|
| 5 |
-
explicit stop_callback(const stop_token& st,
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
```
|
| 11 |
|
| 12 |
-
*Constraints:* `
|
| 13 |
-
`constructible_from<
|
| 14 |
-
|
| 15 |
-
*
|
| 16 |
-
`
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
`std::forward<Callback>(callback)()` is evaluated in the current thread
|
| 21 |
-
before the constructor returns. Otherwise, if `st` has ownership of a
|
| 22 |
-
stop state, acquires shared ownership of that stop state and registers
|
| 23 |
-
the callback with that stop state such that
|
| 24 |
-
`std::forward<Callback>(callback)()` is evaluated by the first call to
|
| 25 |
-
`request_stop()` on an associated `stop_source`.
|
| 26 |
-
|
| 27 |
-
*Throws:* Any exception thrown by the initialization of `callback`.
|
| 28 |
-
|
| 29 |
-
*Remarks:* If evaluating `std::forward<Callback>(callback)()` exits via
|
| 30 |
-
an exception, then `terminate` is invoked [[except.terminate]].
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
~stop_callback();
|
| 34 |
```
|
| 35 |
|
| 36 |
-
*Effects:*
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
concurrently executing on another thread, then the return from the
|
| 40 |
-
invocation of `callback` strongly happens before [[intro.races]]
|
| 41 |
-
`callback` is destroyed. If `callback` is executing on the current
|
| 42 |
-
thread, then the destructor does not block [[defns.block]] waiting for
|
| 43 |
-
the return from the invocation of `callback`. Releases ownership of the
|
| 44 |
-
stop state, if any.
|
| 45 |
|
|
|
|
| 1 |
#### Constructors and destructor <a id="stopcallback.cons">[[stopcallback.cons]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
template<class Initializer>
|
| 5 |
+
explicit stop_callback(const stop_token& st, Initializer&& init)
|
| 6 |
+
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
| 7 |
+
|
| 8 |
+
template<class Initializer>
|
| 9 |
+
explicit stop_callback(stop_token&& st, Initializer&& init)
|
| 10 |
+
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
| 11 |
```
|
| 12 |
|
| 13 |
+
*Constraints:* `CallbackFn` and `Initializer` satisfy
|
| 14 |
+
`constructible_from<CallbackFn, Initializer>`.
|
| 15 |
+
|
| 16 |
+
*Effects:* Initializes *callback-fn* with
|
| 17 |
+
`std::forward<Initializer>(init)` and executes a stoppable callback
|
| 18 |
+
registration [[stoptoken.concepts]]. If a callback is registered with
|
| 19 |
+
`st`’s shared stop state, then `*this` acquires shared ownership of that
|
| 20 |
+
stop state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
~stop_callback();
|
| 24 |
```
|
| 25 |
|
| 26 |
+
*Effects:* Executes a stoppable callback
|
| 27 |
+
deregistration [[stoptoken.concepts]] and releases ownership of the stop
|
| 28 |
+
state, if any.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|