rust/src/test/run-pass/task-comm-11.rs

16 lines
298 B
Rust
Raw Normal View History

use std;
import comm;
import task;
2011-10-20 20:34:04 -07:00
fn start(c: comm::chan<comm::chan<int>>) {
let p: comm::port<int> = comm::port();
comm::send(c, comm::chan(p));
}
2010-08-11 15:05:33 -07:00
2011-04-19 13:35:49 -07:00
fn main() {
let p = comm::port();
2012-01-04 21:14:53 -08:00
let ch = comm::chan(p);
2012-06-30 16:19:07 -07:00
let child = task::spawn(|| start(ch) );
let c = comm::recv(p);
}