-
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
Implement compare_exchange and compare_exchange_weak #30969
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
841b5ac
to
93b5e82
Compare
Just noting that this is not an accepted RFC, so not reviewing yet. |
93b5e82
to
c59950f
Compare
I've updated the implementation to match the accepted RFC. |
/// `compare_exchange` takes two `Ordering` arguments to describe the memory ordering | ||
/// of this operation. The first describes the required ordering if the operation succeeds while | ||
/// the second describes the required ordering when the operation fails. The failure ordering | ||
/// can't be `Acquire` or `AcqRel` and must be equivalent or weaker than the success ordering. |
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.
Could you wrap these comments to 80 chars? (the surrounding style)
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.
Actually the surrounding style seems to wrap comments at 100 chars, which is what I've been using.
Thanks @Amanieu! |
c59950f
to
b4b2a25
Compare
Updated with comments addressed |
Thanks! Just to ensure that we've got all code paths covered, could you make sure that there's at least some call to each cmpxchg instrinsic in the tests? Just to make sure that trans doesn't choke on accident from any of these. |
Done |
This is an implementation of rust-lang/rfcs#1443.
This is an implementation of rust-lang/rfcs#1443.