rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 256 forks source link

example uses deprecated `compare_and_swap` #382

Open amab8901 opened 1 year ago

amab8901 commented 1 year ago

This page says: while lock.compare_and_swap(false, true, Ordering::Acquire) { }

The problem: pub fn compare_and_swap (&self, current: bool, new: bool, order: Ordering) -> [bool] is deprecated.

Request: update the example to make it applicable for latest version of Rust