8000 Fix for corner case where `RwLock` could be acquired in write mode while write locked by Pointerbender · Pull Request #300 · tokio-rs/loom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix for corner case where RwLock could be acquired in write mode while write locked #300

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

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

Pointerbender
Copy link
Contributor

This PR contains a minor 2 line fix for a corner case where a RwLock could erroneously be acquired in write mode while already being write locked. This led to a panic saying loom::RwLock state corrupt: "WouldBlock", while it instead should return the WouldBlock error state on RwLock::try_write or (potentially) signal a deadlock when calling RwLock::write. I also took the liberty of adding some more test cases for RwLock, which will also detect any regressions of this bug.

8000
Copy link
Member
@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! The fix looks good to me, thank you!

@Pointerbender
Copy link
Contributor Author

Hi! This PR was approved a few weeks ago but it is not yet merged. Is this delayed intentionally until the next release (where PRs are then cherry-picked and merged for release) or should it be merged already? :)

@Darksonn Darksonn merged commit 16e5e9a into tokio-rs:master Feb 2, 2023
@Darksonn
Copy link
Contributor
Darksonn commented Feb 2, 2023

We normally merge things immediately. I've gone ahead and merged your PR>

@Pointerbender
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0