diff --git a/tokio/src/runtime/task/mod.rs b/tokio/src/runtime/task/mod.rs index ac1ee157ea2..316b4a49675 100644 --- a/tokio/src/runtime/task/mod.rs +++ b/tokio/src/runtime/task/mod.rs @@ -501,11 +501,12 @@ impl Id { cfg_not_has_atomic_u64! { pub(crate) fn next() -> Self { use once_cell::sync::Lazy; - use crate::loom::Mutex; - static NEXT_ID: Lazy> = Lazy(|| Mutex::new(1)); + use crate::loom::sync::Mutex; + + static NEXT_ID: Lazy> = Lazy::new(|| Mutex::new(1)); let mut lock = NEXT_ID.lock(); let id = *lock; - lock += 1; + *lock += 1; Self(id) } }