2011-03-25 14:19:20 -05:00
|
|
|
// xfail-boot
|
|
|
|
// xfail-stage0
|
2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
|
|
|
import std._task;
|
|
|
|
|
|
|
|
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.
|
|
|
|
_task.sleep(10000u);
|
|
|
|
|
|
|
|
// Try joining tasks that have already finished.
|
|
|
|
join t;
|
|
|
|
|
|
|
|
log "Joined Task.";
|
|
|
|
}
|