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

@ -298,7 +298,8 @@ impl Window {
#[cfg(any(target_os = "linux", target_os = "android"))]
fn handle_next_event(&self) -> bool {
use std::thread::sleep_ms;
use std::thread;
use std::time::Duration;
// TODO(gw): This is an awful hack to work around the
// broken way we currently call X11 from multiple threads.
@ -324,7 +325,7 @@ impl Window {
self.handle_window_event(event)
}
None => {
sleep_ms(16);
thread::sleep(Duration::from_millis(16));
false
}
}