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:
Yilin Chen
2019-02-09 23:16:31 +01:00
committed by Stjepan Glavina
parent ce2147d2b6
commit ec22fb9843
+2 -2
View File
@@ -71,7 +71,7 @@ use std::io;
use std::mem;
use std::cell::RefCell;
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::time::{Duration, Instant};
@@ -165,7 +165,7 @@ pub(crate) enum Direction {
}
/// 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.
thread_local!(static CURRENT_REACTOR: RefCell<Option<HandlePriv>> = RefCell::new(None));