rust/src/test/run-pass/threads.rs

14 lines
205 B
Rust
Raw Normal View History

2011-07-27 07:48:34 -05:00
// -*- rust -*-
2011-08-12 20:34:19 -05:00
use std;
import task;
2011-08-12 20:34:19 -05:00
2011-07-27 07:48:34 -05:00
fn main() {
let i = 10;
2012-01-04 23:14:53 -06:00
while i > 0 { task::spawn {|| child(i); }; i = i - 1; }
#debug("main thread exiting");
2011-07-27 07:48:34 -05:00
}
fn child(&&x: int) { log(debug, x); }
2011-07-27 07:48:34 -05:00