Skip to content
New issue

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

sync: try to lock the parent first in CancellationToken #5561

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

Darksonn
Copy link
Contributor

Deadlock safety requires that the parent is locked before the child, but we can still use try_lock to attempt to lock the parent without releasing the child.

Deadlock safety requires that the parent is locked before the child, but
we can still use `try_lock` to attempt to lock the parent without
releasing the child.
@Darksonn Darksonn added A-tokio-util Area: The tokio-util crate M-sync Module: tokio/sync labels Mar 19, 2023
@Darksonn Darksonn requested a review from hawkw March 19, 2023 14:44
@github-actions github-actions bot added the R-loom Run loom tests on this PR label Mar 19, 2023
@Darksonn Darksonn merged commit b489acb into master Mar 21, 2023
@Darksonn Darksonn deleted the alice/cancel-token-try_lock branch March 21, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate M-sync Module: tokio/sync R-loom Run loom tests on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants