]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-59020.rs
Rollup merge of #61207 - taiki-e:arbitrary_self_types-lifetime-elision-2, r=Centril
[rust.git] / src / test / ui / issue-59020.rs
1 // edition:2018
2 // run-pass
3 // ignore-emscripten no threads support
4 // ignore-sgx no thread sleep support
5
6 use std::thread;
7 use std::time::Duration;
8
9 fn main() {
10     let t1 = thread::spawn(|| {
11         let sleep = Duration::new(0,100_000);
12         for _ in 0..100 {
13             println!("Parking1");
14             thread::park_timeout(sleep);
15         }
16     });
17
18     let t2 = thread::spawn(|| {
19         let sleep = Duration::new(0,100_000);
20         for _ in 0..100 {
21             println!("Parking2");
22             thread::park_timeout(sleep);
23         }
24     });
25
26     t1.join().expect("Couldn't join thread 1");
27     t2.join().expect("Couldn't join thread 2");
28 }