rust/src/test/run-pass/threads.rs
2012-05-07 13:22:42 -07:00

14 lines
215 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); }