rust/src/test/run-pass/lazychan.rs
2011-04-19 13:35:49 -07:00

25 lines
300 B
Rust

// xfail-stage0
// -*- rust -*-
fn main() {
let port[int] p = port();
auto c = chan(p);
let int y;
spawn child(c);
y <- p;
log "received 1";
log y;
check (y == 10);
spawn child(c);
y <- p;
log "received 2";
log y;
check (y == 10);
}
fn child(chan[int] c) {
c <| 10;
}