-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Relax memory ordering used in SameMutexCheck #96619
Conversation
`SameMutexCheck` only requires atomicity for `self.addr`, but does not need ordering of other memory accesses in either the success or failure case. Using `Relaxed`, the code still correctly handles the case when two threads race to store an address.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks. I'll let @joshtriplett review since you explicitly requested it, though.
This LGTM, but requesting a review from @m-ou-se who has been working extensively on the mutex code lately. |
@bors r+ Note that this code will be deleted Soon:tm:, when we get rid of boxed locks on all platforms. :) |
📌 Commit 55a7d18 has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#96603 (Enable full revision in const generics ui tests) - rust-lang#96616 (Relax memory ordering used in `min_stack`) - rust-lang#96619 (Relax memory ordering used in SameMutexCheck) - rust-lang#96628 (Stabilize `bool::then_some`) - rust-lang#96658 (Move callback to the () => {} syntax.) - rust-lang#96677 (Add more tests for label-break-value) - rust-lang#96697 (Enable tracing for all queries) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
SameMutexCheck
only requires atomicity forself.addr
, but does not need ordering of other memory accesses in either the success or failure case. UsingRelaxed
, the code still correctly handles the case when two threads race to store an address.