]> git.lizzy.rs Git - rust.git/blob - src/test/ui/threads-sendsync/threads.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / threads-sendsync / threads.rs
1 // run-pass
2 #![allow(unused_must_use)]
3 // ignore-emscripten no threads support
4
5 use std::thread;
6
7 pub fn main() {
8     let mut i = 10;
9     while i > 0 {
10         thread::spawn({let i = i; move|| child(i)}).join();
11         i = i - 1;
12     }
13     println!("main thread exiting");
14 }
15
16 fn child(x: isize) { println!("{}", x); }