summary refs log tree commit diff
path: root/src/test/run-pass/task-comm-11.rs
blob: f96f9d148d004e5bcef4beea046eb805778d5d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std;
import comm;
import task;

fn start(c: comm::chan<comm::chan<int>>) {
    let p: comm::port<int> = comm::port();
    comm::send(c, comm::chan(p));
}

fn main() {
    let p = comm::port();
    let ch = comm::chan(p);
    let child = task::spawn(|| start(ch) );
    let c = comm::recv(p);
}