From Jason Turner

[stopsource.mem]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpg7ptdhtn/{from.md → to.md} +44 -0
tmp/tmpg7ptdhtn/{from.md → to.md} RENAMED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 called [[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
+