Skip to content

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Dec 24, 2020

Motivation

compare_and_swap is deprecated in 1.50. (rust-lang/rust#79261)

Solution

This patch replaces the uses of compare_and_swap with compare_exchange.

See also the document about compare_and_swap -> compare_exchange(_weak) migration: https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicUsize.html#migrating-to-compare_exchange-and-compare_exchange_weak

@taiki-e taiki-e requested a review from carllerche December 24, 2020 10:24
@taiki-e taiki-e changed the title Replace deprecated compare_and_swap with compare_exchange chore: replace deprecated compare_and_swap with compare_exchange Dec 24, 2020
@Darksonn Darksonn added the A-tokio Area: The main tokio crate label Dec 25, 2020
…omicU64

loom provides AtomicU64 on all platforms, so it makes sense to define it in loom/std/atomic_u64.rs.
@Darksonn Darksonn merged commit 770044c into tokio-rs:master Dec 27, 2020
@taiki-e taiki-e deleted the compare_and_swap branch December 27, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tokio Area: The main tokio crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants