rust/src/test/run-pass/task-comm-11.rs
2012-07-01 19:19:32 -07:00

16 lines
298 B
Rust

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);
}