From Jason Turner

[coroutine.handle.resumption]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpkvzbbwzr/{from.md → to.md} +33 -0
tmp/tmpkvzbbwzr/{from.md → to.md} RENAMED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Resumption <a id="coroutine.handle.resumption">[[coroutine.handle.resumption]]</a>
2
+
3
+ Resuming a coroutine via `resume`, `operator()`, or `destroy` on an
4
+ execution agent other than the one on which it was suspended has
5
+ implementation-defined behavior unless each execution agent either is an
6
+ instance of `std::thread` or `std::jthread`, or is the thread that
7
+ executes `main`.
8
+
9
+ [*Note 1*: A coroutine that is resumed on a different execution agent
10
+ should avoid relying on consistent thread identity throughout, such as
11
+ holding a mutex object across a suspend point. — *end note*]
12
+
13
+ [*Note 2*: A concurrent resumption of the coroutine may result in a
14
+ data race. — *end note*]
15
+
16
+ ``` cpp
17
+ void operator()() const;
18
+ void resume() const;
19
+ ```
20
+
21
+ *Preconditions:* `*this` refers to a suspended coroutine. The coroutine
22
+ is not suspended at its final suspend point.
23
+
24
+ *Effects:* Resumes the execution of the coroutine.
25
+
26
+ ``` cpp
27
+ void destroy() const;
28
+ ```
29
+
30
+ *Preconditions:* `*this` refers to a suspended coroutine.
31
+
32
+ *Effects:* Destroys the coroutine [[dcl.fct.def.coroutine]].
33
+