]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-59020.rs
Rollup merge of #60685 - dtolnay:spdx, r=nikomatsakis
[rust.git] / src / test / run-pass / 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 }