rust/src/test/run-pass/threads.rs
2012-07-01 19:19:32 -07:00

14 lines
213 B
Rust

// -*- rust -*-
use std;
import task;
fn main() {
let mut i = 10;
while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
#debug("main thread exiting");
}
fn child(&&x: int) { log(debug, x); }