2011-07-27 07:48:34 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-08-12 20:34:19 -05:00
|
|
|
use std;
|
|
|
|
|
2011-07-27 07:48:34 -05:00
|
|
|
fn main() {
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut i = 10;
|
2012-06-30 18:19:07 -05:00
|
|
|
while i > 0 { task::spawn(|copy i| child(i) ); i = i - 1; }
|
2012-08-22 19:24:52 -05:00
|
|
|
debug!("main thread exiting");
|
2011-07-27 07:48:34 -05:00
|
|
|
}
|
|
|
|
|
2011-12-22 19:53:53 -06:00
|
|
|
fn child(&&x: int) { log(debug, x); }
|
2011-07-27 07:48:34 -05:00
|
|
|
|