From Jason Turner

[stopsource.mem]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpzuwy4fze/{from.md → to.md} +20 -24
tmp/tmpzuwy4fze/{from.md → to.md} RENAMED
@@ -1,44 +1,40 @@
1
- #### Members <a id="stopsource.mem">[[stopsource.mem]]</a>
2
 
3
  ``` cpp
4
- [[nodiscard]] stop_token get_token() const noexcept;
 
 
 
 
 
 
 
 
 
 
5
  ```
6
 
7
  *Returns:* `stop_token()` if `stop_possible()` is `false`; otherwise a
8
- new associated `stop_token` object.
 
9
 
10
  ``` cpp
11
- [[nodiscard]] bool stop_possible() const noexcept;
12
  ```
13
 
14
- *Returns:* `true` if `*this` has ownership of a stop state; otherwise,
15
- `false`.
16
 
17
  ``` cpp
18
- [[nodiscard]] bool stop_requested() const noexcept;
19
  ```
20
 
21
- *Returns:* `true` if `*this` has ownership of a stop state that has
22
  received a stop request; otherwise, `false`.
23
 
24
  ``` cpp
25
  bool request_stop() noexcept;
26
  ```
27
 
28
- *Effects:* If `*this` does not have ownership of a stop state, returns
29
- `false`. Otherwise, atomically determines whether the owned stop state
30
- has received a stop request, and if not, makes a stop request. The
31
- determination and making of the stop request are an atomic
32
- read-modify-write operation [[intro.races]]. If the request was made,
33
- the callbacks registered by associated `stop_callback` objects are
34
- synchronously called. If an invocation of a callback exits via an
35
- exception then `terminate` is invoked [[except.terminate]].
36
-
37
- [*Note 1*: A stop request includes notifying all condition variables of
38
- type `condition_variable_any` temporarily registered during an
39
- interruptible wait [[thread.condvarany.intwait]]. — *end note*]
40
-
41
- *Ensures:* `stop_possible()` is `false` or `stop_requested()` is `true`.
42
-
43
- *Returns:* `true` if this call made a stop request; otherwise `false`.
44
 
 
1
+ #### Member functions <a id="stopsource.mem">[[stopsource.mem]]</a>
2
 
3
  ``` cpp
4
+ void swap(stop_source& rhs) noexcept;
5
+ ```
6
+
7
+ *Effects:* Equivalent to:
8
+
9
+ ``` cpp
10
+ stop-state.swap(rhs.stop-state);
11
+ ```
12
+
13
+ ``` cpp
14
+ stop_token get_token() const noexcept;
15
  ```
16
 
17
  *Returns:* `stop_token()` if `stop_possible()` is `false`; otherwise a
18
+ new associated `stop_token` object; i.e., its *stop-state* member is
19
+ equal to the *stop-state* member of `*this`.
20
 
21
  ``` cpp
22
+ bool stop_possible() const noexcept;
23
  ```
24
 
25
+ *Returns:* *`stop-state`*` != nullptr`.
 
26
 
27
  ``` cpp
28
+ bool stop_requested() const noexcept;
29
  ```
30
 
31
+ *Returns:* `true` if *stop-state* refers to a stop state that has
32
  received a stop request; otherwise, `false`.
33
 
34
  ``` cpp
35
  bool request_stop() noexcept;
36
  ```
37
 
38
+ *Effects:* Executes a stop request operation [[stoptoken.concepts]] on
39
+ the associated stop state, if any.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40