From 9c569fb7ec0f2cd11eb98a332accc208d71bdabf Mon Sep 17 00:00:00 2001 From: Guillume DIDIER Date: Thu, 10 Jun 2021 11:23:13 +0200 Subject: [PATCH] Rust nightly update - turn_lock --- turn_lock/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/turn_lock/src/lib.rs b/turn_lock/src/lib.rs index 3e1ac53..be13336 100644 --- a/turn_lock/src/lib.rs +++ b/turn_lock/src/lib.rs @@ -1,7 +1,8 @@ use std::cell::UnsafeCell; +use std::hint::spin_loop; use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; -use std::sync::atomic::{spin_loop_hint, AtomicUsize, Ordering}; +use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::Arc; // FIXME There may be significant unsafety if wait is called twice ? @@ -33,7 +34,7 @@ impl RawTurnLock { pub unsafe fn wait(&self, turn: usize) { let mut current = self.turn.load(Ordering::Acquire); while current < self.num_turns && current != turn { - spin_loop_hint(); + spin_loop(); current = self.turn.load(Ordering::Acquire); } if current >= self.num_turns {