2011-07-27 14:48:34 +02:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-08-12 18:34:19 -07:00
|
|
|
use std;
|
2011-12-13 16:25:51 -08:00
|
|
|
import task;
|
2011-08-12 18:34:19 -07:00
|
|
|
|
2011-07-27 14:48:34 +02:00
|
|
|
fn main() {
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut i = 10;
|
2012-06-26 13:55:56 -07:00
|
|
|
while i > 0 { task::spawn({|copy i| child(i); }); i = i - 1; }
|
2011-12-22 14:42:52 -08:00
|
|
|
#debug("main thread exiting");
|
2011-07-27 14:48:34 +02:00
|
|
|
}
|
|
|
|
|
2011-12-22 17:53:53 -08:00
|
|
|
fn child(&&x: int) { log(debug, x); }
|
2011-07-27 14:48:34 +02:00
|
|
|
|