2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-07-12 17:27:17 -05:00
|
|
|
|
|
|
|
use std;
|
|
|
|
import std::task;
|
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn start(chan[chan[str]] c) {
|
2011-07-18 14:02:26 -05:00
|
|
|
let port[str] p;
|
|
|
|
|
|
|
|
p = port();
|
2010-08-11 17:05:33 -05:00
|
|
|
c <| chan(p);
|
2011-07-18 14:02:26 -05:00
|
|
|
p |> a;
|
|
|
|
log_err a;
|
|
|
|
p |> b;
|
|
|
|
log_err b;
|
|
|
|
|
|
|
|
auto a;
|
|
|
|
auto b;
|
2010-08-11 17:05:33 -05:00
|
|
|
}
|
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn main() {
|
2011-07-18 14:02:26 -05:00
|
|
|
let port[chan[str]] p;
|
|
|
|
auto child;
|
|
|
|
|
|
|
|
p = port();
|
|
|
|
child = spawn start(chan(p));
|
2011-07-22 18:05:26 -05:00
|
|
|
auto c;
|
2011-07-18 14:02:26 -05:00
|
|
|
|
|
|
|
p |> c;
|
2010-08-11 17:05:33 -05:00
|
|
|
c <| "A";
|
|
|
|
c <| "B";
|
2011-07-12 17:27:17 -05:00
|
|
|
task::yield();
|
2011-05-26 20:17:13 -05:00
|
|
|
}
|