Commit fa302a3
[roll] Roll fuchsia [fuchsia-async] Add ScopeRef::cancel()
This allows cancelling a scope when it is not owned. This might be
useful for cancelling a scope from within a task spawned on that scope,
for example.
Now Scope only differs from ScopeRef in that it
1. Cancels the scope automatically on drop.
2. Allows joining the scope (waiting for no tasks + closing).
Joining the scope could also be allowed from a ScopeRef, but as I
explain in the code comment, this seems less of a good idea.
Conceptually, the Scope/ScopeRef relationship is aligned with the
Task/JoinHandle relationship in that the first "owned" variant cancels
the object on drop. We should probably align the naming of these.
Original-Bug: 339724492
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1152812
Original-Revision: eda1014f8bcc09a7f78b4895caec0e0a5c839282
GitOrigin-RevId: 35385458a4be89cad5657076c7215a6ae5e21a8e
Change-Id: Ide8f2b1d309cc627564377408ed179b1371c06bd1 parent f98761f commit fa302a3
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
0 commit comments