mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
reactor: replace ATOMIC_USIZE_INIT with AtomicUsize::new(0) (#889)
ATOMIC_BOOL_INIT is deprecated since 1.34 because the const fn AtomicUsize::new is now preferred. As deny(warnings) is set, tokio fails to build on latest nightly. This will fix it. Signed-off-by: Yilin Chen <[email protected]>
This commit is contained in:
committed by
Stjepan Glavina
parent
ce2147d2b6
commit
ec22fb9843
@@ -71,7 +71,7 @@ use std::io;
|
|||||||
use std::mem;
|
use std::mem;
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::sync::atomic::Ordering::{Relaxed, SeqCst};
|
use std::sync::atomic::Ordering::{Relaxed, SeqCst};
|
||||||
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
|
use std::sync::atomic::AtomicUsize;
|
||||||
use std::sync::{Arc, Weak};
|
use std::sync::{Arc, Weak};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
@@ -165,7 +165,7 @@ pub(crate) enum Direction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The global fallback reactor.
|
/// The global fallback reactor.
|
||||||
static HANDLE_FALLBACK: AtomicUsize = ATOMIC_USIZE_INIT;
|
static HANDLE_FALLBACK: AtomicUsize = AtomicUsize::new(0);
|
||||||
|
|
||||||
/// Tracks the reactor for the current execution context.
|
/// Tracks the reactor for the current execution context.
|
||||||
thread_local!(static CURRENT_REACTOR: RefCell<Option<HandlePriv>> = RefCell::new(None));
|
thread_local!(static CURRENT_REACTOR: RefCell<Option<HandlePriv>> = RefCell::new(None));
|
||||||
|
|||||||
Reference in New Issue
Block a user