2011-08-09 16:07:49 -07:00
|
|
|
// FIXME: this test is xfailed until sending strings is legal again.
|
|
|
|
|
|
|
|
//xfail-stage0
|
|
|
|
//xfail-stage1
|
|
|
|
//xfail-stage2
|
|
|
|
//xfail-stage3
|
|
|
|
|
2011-07-12 15:27:17 -07:00
|
|
|
use std;
|
|
|
|
import std::task;
|
2011-08-06 10:07:39 -07:00
|
|
|
import std::comm;
|
2011-07-12 15:27:17 -07:00
|
|
|
|
2011-08-10 09:27:22 -07:00
|
|
|
fn start(c: comm::_chan<str>) {
|
2011-08-13 00:10:18 -07:00
|
|
|
let p = comm::mk_port::<str>();
|
2011-08-08 13:38:20 -07:00
|
|
|
c.send(p.mk_chan().unsafe_ptr());
|
2011-07-18 12:02:26 -07:00
|
|
|
|
2011-07-28 18:01:27 -07:00
|
|
|
let a;
|
|
|
|
let b;
|
2011-08-06 10:07:39 -07:00
|
|
|
a = p.recv();
|
2011-07-18 12:02:26 -07:00
|
|
|
log_err a;
|
2011-08-06 10:07:39 -07:00
|
|
|
b = p.recv();
|
2011-07-18 12:02:26 -07:00
|
|
|
log_err b;
|
2010-08-11 15:05:33 -07:00
|
|
|
}
|
|
|
|
|
2011-04-19 13:35:49 -07:00
|
|
|
fn main() {
|
2011-08-13 15:20:11 -07:00
|
|
|
let p = comm::mk_port();
|
|
|
|
let child = task::_spawn(bind start(p.mk_chan()));
|
2011-07-18 12:02:26 -07:00
|
|
|
|
2011-08-13 15:20:11 -07:00
|
|
|
let c = p.recv();
|
2011-08-06 10:07:39 -07:00
|
|
|
c.send("A");
|
|
|
|
c.send("B");
|
2011-07-12 15:27:17 -07:00
|
|
|
task::yield();
|
2011-08-06 10:07:39 -07:00
|
|
|
}
|