Replace deprecated compare_and_swap with compare_exchange

This commit is contained in:
Taiki Endo 2020-12-24 21:22:43 +09:00
parent 337af8182a
commit c4d019827f
1 changed files with 3 additions and 2 deletions

View File

@ -497,9 +497,10 @@ impl State {
/// Notifies a sleeping ticker.
#[inline]
fn notify(&self) {
if !self
if self
.notified
.compare_and_swap(false, true, Ordering::SeqCst)
.compare_exchange(false, true, Ordering::SeqCst, Ordering::SeqCst)
.is_ok()
{
let waker = self.sleepers.lock().unwrap().notify();
if let Some(w) = waker {