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
|
|
|
|
|
2011-07-12 17:27:17 -05:00
|
|
|
use std;
|
|
|
|
import std::task;
|
2011-08-06 12:07:39 -05:00
|
|
|
import std::comm;
|
2011-07-12 17:27:17 -05:00
|
|
|
|
2011-08-06 12:07:39 -05:00
|
|
|
fn start(pcc: *u8) {
|
|
|
|
let c = comm::chan_from_unsafe_ptr(pcc);
|
2011-08-08 15:38:20 -05:00
|
|
|
let p = comm::mk_port[str]();
|
|
|
|
c.send(p.mk_chan().unsafe_ptr());
|
2011-07-18 14:02:26 -05:00
|
|
|
|
2011-07-28 20:01:27 -05:00
|
|
|
let a;
|
|
|
|
let b;
|
2011-08-06 12:07:39 -05:00
|
|
|
a = p.recv();
|
2011-07-18 14:02:26 -05:00
|
|
|
log_err a;
|
2011-08-06 12:07:39 -05:00
|
|
|
b = p.recv();
|
2011-07-18 14:02:26 -05:00
|
|
|
log_err b;
|
2010-08-11 17:05:33 -05:00
|
|
|
}
|
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn main() {
|
2011-08-08 15:38:20 -05:00
|
|
|
let p = comm::mk_port[*u8]();
|
|
|
|
let child = spawn start(p.mk_chan().unsafe_ptr());
|
2011-07-18 14:02:26 -05:00
|
|
|
|
2011-08-08 15:38:20 -05:00
|
|
|
let pc = p.recv();
|
|
|
|
let c = comm::chan_from_unsafe_ptr(pc);
|
2011-08-06 12:07:39 -05:00
|
|
|
c.send("A");
|
|
|
|
c.send("B");
|
2011-07-12 17:27:17 -05:00
|
|
|
task::yield();
|
2011-08-06 12:07:39 -05:00
|
|
|
}
|