mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
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 <te316e89@gmail.com> * Update tokio/src/sync/task/atomic_waker.rs Co-authored-by: Taiki Endo <te316e89@gmail.com> * fmt Co-authored-by: Taiki Endo <te316e89@gmail.com>
This commit is contained in:
parent
60d88840f4
commit
cc97fb8a5f
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user