aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/task-comm-12.rs
blob: 2aa38b86aa3d6b26127efd7d23bf6cd04888a958 (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.";
}