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

23 lines
390 B
Rust
Raw Normal View History

// xfail-stage0
// xfail-stage1
// xfail-stage2
use std;
import std::task;
2011-04-19 13:35:49 -07:00
fn start(chan[chan[str]] c) {
2010-08-11 15:05:33 -07: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 15:05:33 -07:00
}
2011-04-19 13:35:49 -07:00
fn main() {
2010-08-11 15:05:33 -07:00
let port[chan[str]] p = port();
auto child = spawn start(chan(p));
auto c; p |> c;
2010-08-11 15:05:33 -07:00
c <| "A";
c <| "B";
task::yield();
}