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

15 lines
289 B
Rust
Raw Normal View History

use std;
import std::comm;
2011-08-12 19:36:52 -05:00
import std::task;
fn# start(c: comm::chan<comm::chan<int>>) {
let p: comm::port<int> = comm::port();
comm::send(c, comm::chan(p));
}
2010-08-11 17:05:33 -05:00
2011-04-19 15:35:49 -05:00
fn main() {
let p = comm::port();
let child = task::spawn2(comm::chan(p), start);
let c = comm::recv(p);
}