]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-59020.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-59020.rs
1 // edition:2018
2 // run-pass
3 // ignore-emscripten no threads support
4
5 use std::thread;
6 use std::time::Duration;
7
8 fn main() {
9 let t1 = thread::spawn(|| {
10 let sleep = Duration::new(0,100_000);
11 for _ in 0..100 {
12 println!("Parking1");
13 thread::park_timeout(sleep);
14 }
15 });
16
17 let t2 = thread::spawn(|| {
18 let sleep = Duration::new(0,100_000);
19 for _ in 0..100 {
20 println!("Parking2");
21 thread::park_timeout(sleep);
22 }
23 });
24
25 t1.join().expect("Couldn't join thread 1");
26 t2.join().expect("Couldn't join thread 2");
27 }