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

14 lines
213 B
Rust
Raw Normal View History

2011-07-27 14:48:34 +02:00
// -*- rust -*-
2011-08-12 18:34:19 -07:00
use std;
import task;
2011-08-12 18:34:19 -07:00
2011-07-27 14:48:34 +02:00
fn main() {
let mut i = 10;
2012-06-30 16:19:07 -07:00
while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
#debug("main thread exiting");
2011-07-27 14:48:34 +02:00
}
fn child(&&x: int) { log(debug, x); }
2011-07-27 14:48:34 +02:00