rust/src/test/run-pass/task-comm-12.rs

20 lines
372 B
Rust
Raw Normal View History

use std;
import std::task;
2011-07-27 14:19:39 +02:00
fn main() { test00(); }
2011-10-20 20:34:04 -07:00
fn start(&&task_number: int) { log "Started / Finished task."; }
fn test00() {
2011-07-27 14:19:39 +02:00
let i: int = 0;
let t = task::spawn_joinable(i, start);
// Sleep long enough for the task to finish.
task::sleep(10000u);
// Try joining tasks that have already finished.
task::join(t);
log "Joined task.";
}