rust/src/test/run-pass/basic-1.rs

24 lines
412 B
Rust
Raw Normal View History

// xfail-stage0
2010-08-09 06:53:37 -07:00
// -*- rust -*-
2011-07-27 14:19:39 +02:00
fn a(c: chan[int]) { c <| 10; }
2010-08-09 06:53:37 -07:00
2011-04-19 13:35:49 -07:00
fn main() {
2011-07-27 14:19:39 +02:00
let p: port[int] = port();
2010-08-09 06:53:37 -07:00
spawn a(chan(p));
spawn b(chan(p));
2011-07-27 14:19:39 +02:00
let n: int = 0;
p |> n;
p |> n;
2011-07-27 14:19:39 +02:00
// log "Finished.";
2010-08-09 06:53:37 -07:00
}
2011-07-27 14:19:39 +02:00
fn b(c: chan[int]) {
// log "task b0";
// log "task b1";
// log "task b2";
// log "task b3";
// log "task b4";
// log "task b5";
2010-08-09 06:53:37 -07:00
c <| 10;
}