We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle::enter()
When calling Handle::enter() multiple times and dropping guards in an unexpected order, the "current runtime" is set incorrectly.
This is because the guard stores the previous state and updates the current runtime on drop.
#[test] fn interleave_enter() { let rt1 = rt(); let rt2 = rt(); let rt3 = rt(); let _enter1 = rt1.enter(); let enter2 = rt2.enter(); let enter3 = rt3.enter(); drop(enter2); drop(enter3); drop(rt2); let handle = tokio::spawn(async {}); rt1.block_on(handle).unwrap(); }
The text was updated successfully, but these errors were encountered:
@Darksonn Why do we check that EnterGuard is Send here? It would not be good for the guard to move threads...
EnterGuard
Send
Sorry, something went wrong.
Unfortunately, we can't deprecate the method. As far as I can see, the options are:
block_on
enter()
Either way, EnterGuard should not be Send (Sync is fine).
Sync
Successfully merging a pull request may close this issue.
When calling
Handle::enter()
multiple times and dropping guards in an unexpected order, the "current runtime" is set incorrectly.This is because the guard stores the previous state and updates the current runtime on drop.
Repro:
The text was updated successfully, but these errors were encountered: