Suppress deprecated warnings for spin_loop_hint (#3497)

* Suppress deprecated warnings for spin_loop_hint

* Update tokio/src/loom/std/mod.rs

Co-authored-by: Taiki Endo <[email protected]>

* Update tokio/src/sync/task/atomic_waker.rs

Co-authored-by: Taiki Endo <[email protected]>

* fmt

Co-authored-by: Taiki Endo <[email protected]>
This commit is contained in:
Artem Vorotnikov
2021-02-01 15:55:21 +03:00
committed by GitHub
co-authored by Taiki Endo
parent 60d88840f4
commit cc97fb8a5f
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -74,7 +74,10 @@ pub(crate) mod sync {
pub(crate) use crate::loom::std::atomic_u8::AtomicU8;
pub(crate) use crate::loom::std::atomic_usize::AtomicUsize;
pub(crate) use std::sync::atomic::{fence, spin_loop_hint, AtomicBool, Ordering};
pub(crate) use std::sync::atomic::{fence, AtomicBool, Ordering};
// TODO: once we bump MSRV to 1.49+, use `hint::spin_loop` instead.
#[allow(deprecated)]
pub(crate) use std::sync::atomic::spin_loop_hint;
}
}
+2
View File
@@ -223,6 +223,8 @@ impl AtomicWaker {
waker.wake();
// This is equivalent to a spin lock, so use a spin hint.
// TODO: once we bump MSRV to 1.49+, use `hint::spin_loop` instead.
#[allow(deprecated)]
atomic::spin_loop_hint();
}
state => {