Use thread::sleep instead of deprecated sleep_ms

Similarly, change one instance of `thread::park_timeout_ms`.

Fixes #8694
This commit is contained in:
James Sanders 2015-11-27 17:37:33 -07:00
parent b737e4e0fa
commit 3659218c59
10 changed files with 65 additions and 25 deletions

View file

@ -15,6 +15,7 @@ use std::sync::Arc;
use std::sync::atomic::{self, AtomicBool};
use std::sync::mpsc::{channel, Receiver, Select};
use std::thread::{self, spawn, Thread};
use std::time::Duration;
use util::task::spawn_named;
/// A quick hack to work around the removal of [`std::old_io::timer::Timer`](
@ -37,7 +38,7 @@ impl CancelableOneshotTimer {
let mut park_time = duration;
loop {
thread::park_timeout_ms(park_time.get() as u32);
thread::park_timeout(Duration::from_millis(park_time.get()));
if canceled_clone.load(atomic::Ordering::Relaxed) {
return;