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

35 lines
631 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(pcc: *u8) {
let c = comm::chan_from_unsafe_ptr(pcc);
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[*u8]();
let child = spawn start(p.mk_chan().unsafe_ptr());
let pc = p.recv();
let c = comm::chan_from_unsafe_ptr(pc);
c.send("A");
c.send("B");
task::yield();
}