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

33 lines
547 B
Rust
Raw Normal View History

2011-08-09 18:07:49 -05:00
// FIXME: this test is xfailed until sending strings is legal again.
//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3
use std;
import std::task;
import std::comm;
fn start(c: comm::_chan[str]) {
let p = comm::mk_port[str]();
c.send(p.mk_chan().unsafe_ptr());
let a;
let b;
a = p.recv();
log_err a;
b = p.recv();
log_err b;
2010-08-11 17:05:33 -05:00
}
2011-04-19 15:35:49 -05:00
fn main() {
let p = comm::mk_port();
let child = task::_spawn(bind start(p.mk_chan()));
let c = p.recv();
c.send("A");
c.send("B");
task::yield();
}