-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure
AsyncContext
is correctly exited when a for
-await
loop i…
…s abruptly exited (via `break` or `continue`). The simple solution is to just move the context swap at the end of the loop body into a `finally` block, so that it runs even if the loop exits via a different code path. Note that if the abrupt exit is a `return`, then swap runs twice, but this is okay since the exit operation is idempotent. PiperOrigin-RevId: 715856725
- Loading branch information
1 parent
2d27dff
commit 64d9caa
Showing
2 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters