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

19 lines
361 B
Rust
Raw Normal View History

// xfail-stage0
// xfail-stage1
// xfail-stage2
2011-04-19 15:35:49 -05:00
fn start(chan[chan[str]] c) {
2010-08-11 17:05:33 -05:00
let port[str] p = port();
c <| chan(p);
auto a; p |> a;
// auto b; p |> b; // Never read the second string.
2010-08-11 17:05:33 -05:00
}
2011-04-19 15:35:49 -05:00
fn main() {
2010-08-11 17:05:33 -05:00
let port[chan[str]] p = port();
auto child = spawn "start" start(chan(p));
auto c; p |> c;
2010-08-11 17:05:33 -05:00
c <| "A";
c <| "B";
yield;
}