smol-rs / concurrent-queue

Concurrent multi-producer multi-consumer queue
Apache License 2.0
254 stars 22 forks source link

Replace deprecated compare_and_swap with compare_exchange #7

Closed taiki-e closed 3 years ago

taiki-e commented 3 years ago

compare_and_swap is deprecated in 1.50. (https://github.com/rust-lang/rust/pull/79261) 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