2011-07-27 07:48:34 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-08-12 20:34:19 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import task;
|
2011-08-12 20:34:19 -05:00
|
|
|
|
2011-07-27 07:48:34 -05:00
|
|
|
fn main() {
|
2011-08-19 17:16:48 -05:00
|
|
|
let i = 10;
|
2012-01-04 23:14:53 -06:00
|
|
|
while i > 0 { task::spawn {|| child(i); }; i = i - 1; }
|
2011-12-22 16:42:52 -06: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
|
|
|
|