mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02: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 <[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:
co-authored by
Taiki Endo
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_u8::AtomicU8;
|
||||||
pub(crate) use crate::loom::std::atomic_usize::AtomicUsize;
|
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();
|
waker.wake();
|
||||||
|
|
||||||
// This is equivalent to a spin lock, so use a spin hint.
|
// 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();
|
atomic::spin_loop_hint();
|
||||||
}
|
}
|
||||||
state => {
|
state => {
|
||||||
|
|||||||
Reference in New Issue
Block a user