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;
|
2011-10-13 23:23:07 -05:00
|
|
|
while i > 0 { task::spawn(copy i, child); i = i - 1; }
|
2011-08-19 17:16:48 -05:00
|
|
|
log "main thread exiting";
|
2011-07-27 07:48:34 -05:00
|
|
|
}
|
|
|
|
|
2011-10-20 22:34:04 -05:00
|
|
|
fn child(&&x: int) { log x; }
|
2011-07-27 07:48:34 -05:00
|
|
|
|