mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use thread::sleep instead of deprecated sleep_ms
Similarly, change one instance of `thread::park_timeout_ms`. Fixes #8694
This commit is contained in:
parent
b737e4e0fa
commit
3659218c59
10 changed files with 65 additions and 25 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue