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

replace deprecated compare_and_swap() with compare_exchange() #1080

Merged
merged 3 commits into from
Mar 3, 2021

Conversation

rich-murphey
Copy link
Contributor

AtomicU32::compare_and_swap() is marked deprecated, in favor of compare_exchange().
compare_exchange() is fallible, so we continue to loop if it fails.
According to the docs, for the original AcqRel ordering, the equivalent failure ordering is Acquire.
https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.html#method.compare_exchange_weak

Copy link
Collaborator

@abonander abonander left a comment

Choose a reason for hiding this comment

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

See comment.

sqlx-core/src/pool/inner.rs Outdated Show resolved Hide resolved
@abonander abonander merged commit edcc91c into launchbadge:master Mar 3, 2021
@abonander
Copy link
Collaborator

Thanks!

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.

2 participants