aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-12.rs
blob: d4a135c2a39e477c253bdc2c3b98dd212dd7f58b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// xfail-boot
// xfail-stage0
// xfail-stage1
// xfail-stage2
use std;
import std.Task;

fn main() -> () {
    test00();
}

fn start(int task_number) {
    log "Started / Finished Task.";
}
    
fn test00() {    
    let int i = 0;
    let task t = spawn thread "child" start(i);
    
    // Sleep long enough for the task to finish.
    Task.sleep(10000u);
    
    // Try joining tasks that have already finished.
    join t;
    
    log "Joined Task.";
}