summary refs log tree commit diff
path: root/src/test/run-pass/task-comm-11.rs
blob: b1e23b2443a95c74af5d62c4b7ce18150d190858 (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);
}