2011-03-25 14:19:20 -05:00
|
|
|
// xfail-boot
|
|
|
|
// xfail-stage0
|
2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
2011-05-06 15:13:13 -05:00
|
|
|
import std.Task;
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
test00();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn start(int task_number) {
|
|
|
|
log "Started / Finished Task.";
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test00() {
|
|
|
|
let int i = 0;
|
2010-09-07 20:01:35 -05:00
|
|
|
let task t = spawn thread "child" start(i);
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
// Sleep long enough for the task to finish.
|
2011-05-06 15:13:13 -05:00
|
|
|
Task.sleep(10000u);
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
// Try joining tasks that have already finished.
|
|
|
|
join t;
|
|
|
|
|
|
|
|
log "Joined Task.";
|
|
|
|
}
|