-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rt: fix accidental unsetting of current handle (#5178)
An earlier change updated `enter_runtime` to also set the current handle. However, the change did not store the `SetCurrentGuard`, so the "current handle" was immediately unset. This patch stores the `SetCurrentGuard` in the `EnterRuntimeGuard`. No existing test exposed this bug because all tests went via `Runtime` instead of `Handle`. Currently, `Runtime` is still explicitly setting the handle before entering runtime, so all tests still passed. A new test is added that covers the case of calling `Handle::block_on` and accessing the current handle.
- Loading branch information
1 parent
236d026
commit 53cba02
Showing
2 changed files
with
34 additions
and
13 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