rust/tests/ui/threads-sendsync/spawn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
209 B
Rust
Raw Normal View History

// run-pass
// ignore-emscripten no threads support
2015-02-18 07:24:34 +08:00
use std::thread;
2011-08-12 01:46:57 +08:00
pub fn main() {
2015-02-18 07:24:34 +08:00
thread::spawn(move|| child(10)).join().ok().unwrap();
2012-01-05 13:14:53 +08:00
}
fn child(i: isize) { println!("{}", i); assert_eq!(i, 10); }