2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-07-12 17:27:17 -05:00
|
|
|
|
2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
2011-07-12 17:27:17 -05:00
|
|
|
import std::task;
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
test00();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn start(int task_number) {
|
2011-05-12 10:24:54 -05:00
|
|
|
log "Started / Finished task.";
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test00() {
|
|
|
|
let int i = 0;
|
2011-07-12 17:27:17 -05:00
|
|
|
let task t = spawn start(i);
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
// Sleep long enough for the task to finish.
|
2011-07-12 17:27:17 -05:00
|
|
|
task::sleep(10000u);
|
2010-08-24 23:06:56 -05:00
|
|
|
|
|
|
|
// Try joining tasks that have already finished.
|
2011-07-12 17:27:17 -05:00
|
|
|
task::join(t);
|
2010-08-24 23:06:56 -05:00
|
|
|
|
2011-05-12 10:24:54 -05:00
|
|
|
log "Joined task.";
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|