rust/src/test/run-pass/threads.rs
2012-01-06 22:40:31 -08:00

14 lines
205 B
Rust

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