mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #8705 - jsanders:fix-sleep-ms-deprecations, r=metajack,Wafflespeanut
Use thread::sleep instead of deprecated sleep_ms Similarly, change one instance of `thread::park_timeout_ms`. Fixes #8694 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8705) <!-- Reviewable:end -->
This commit is contained in:
commit
0f72049363
10 changed files with 65 additions and 25 deletions
|
@ -38,7 +38,8 @@ use std::borrow::ToOwned;
|
|||
use std::collections::BTreeMap;
|
||||
use std::net::SocketAddr;
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::thread::{self, sleep_ms};
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use url::Url;
|
||||
use util::prefs::{get_pref, reset_all_prefs, reset_pref, set_pref, PrefValue};
|
||||
use util::task::spawn_named;
|
||||
|
@ -228,7 +229,7 @@ impl Handler {
|
|||
return Ok(x)
|
||||
};
|
||||
|
||||
sleep_ms(interval);
|
||||
thread::sleep(Duration::from_millis(interval));
|
||||
};
|
||||
|
||||
Err(WebDriverError::new(ErrorStatus::Timeout,
|
||||
|
@ -319,7 +320,7 @@ impl Handler {
|
|||
let timeout = self.load_timeout;
|
||||
let timeout_chan = sender;
|
||||
thread::spawn(move || {
|
||||
sleep_ms(timeout);
|
||||
thread::sleep(Duration::from_millis(timeout as u64));
|
||||
let _ = timeout_chan.send(LoadStatus::LoadTimeout);
|
||||
});
|
||||
|
||||
|
@ -704,7 +705,7 @@ impl Handler {
|
|||
break;
|
||||
};
|
||||
|
||||
sleep_ms(interval)
|
||||
thread::sleep(Duration::from_millis(interval))
|
||||
}
|
||||
|
||||
let img = match img {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue