1 use std::sync::{Arc, Mutex};
3 use std::time::Duration;
6 #[cfg_attr(target_os = "emscripten", ignore)]
8 let finished = Arc::new(Mutex::new(false));
9 let t_finished = finished.clone();
10 thread::spawn(move || {
11 thread::sleep(Duration::new(u64::MAX, 0));
12 *t_finished.lock().unwrap() = true;
14 thread::sleep(Duration::from_millis(100));
15 assert_eq!(*finished.lock().unwrap(), false);