2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2010-11-02 13:11:58 -05:00
|
|
|
impure fn a(chan[int] c) {
|
2010-06-23 23:03:09 -05:00
|
|
|
if (true) {
|
|
|
|
log "task a";
|
|
|
|
log "task a";
|
|
|
|
log "task a";
|
|
|
|
log "task a";
|
|
|
|
log "task a";
|
|
|
|
}
|
|
|
|
c <| 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn k(int x) -> int {
|
|
|
|
ret 15;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn g(int x, str y) -> int {
|
|
|
|
log x;
|
|
|
|
log y;
|
|
|
|
let int z = k(1);
|
|
|
|
ret z;
|
|
|
|
}
|
|
|
|
|
2010-11-02 13:11:58 -05:00
|
|
|
impure fn main() {
|
2010-06-23 23:03:09 -05:00
|
|
|
let int n = 2 + 3 * 7;
|
|
|
|
let str s = "hello there";
|
|
|
|
let port[int] p = port();
|
|
|
|
spawn a(chan(p));
|
|
|
|
spawn b(chan(p));
|
|
|
|
let int x = 10;
|
|
|
|
x = g(n,s);
|
|
|
|
log x;
|
|
|
|
n <- p;
|
|
|
|
n <- p;
|
|
|
|
// FIXME: use signal-channel for this.
|
|
|
|
log "children finished, root finishing";
|
|
|
|
}
|
|
|
|
|
2010-11-02 13:11:58 -05:00
|
|
|
impure fn b(chan[int] c) {
|
2010-06-23 23:03:09 -05:00
|
|
|
if (true) {
|
|
|
|
log "task b";
|
|
|
|
log "task b";
|
|
|
|
log "task b";
|
|
|
|
log "task b";
|
|
|
|
log "task b";
|
|
|
|
log "task b";
|
|
|
|
}
|
|
|
|
c <| 10;
|
|
|
|
}
|