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

30 lines
502 B
Rust
Raw Normal View History

2011-08-09 23:07:49 +00:00
// FIXME: this test is xfailed until sending strings is legal again.
//xfail-test
2011-08-09 23:07:49 +00:00
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 22:05:33 +00:00
}
2011-04-19 20:35:49 +00: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();
}