]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-59020.rs
Auto merge of #61421 - vorner:string-in-rc-into-raw-docs, r=RalfJung
[rust.git] / src / test / run-pass / 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 }