2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-05-03 20:13:51 -05:00
|
|
|
// xfail-stage1
|
|
|
|
// xfail-stage2
|
2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
2011-05-12 10:24:54 -05:00
|
|
|
import std::_task;
|
2010-08-24 23:06:56 -05:00
|
|
|
|
2011-04-19 15:35:49 -05:00
|
|
|
fn start(chan[int] c, int start, int number_of_messages) {
|
2010-08-24 23:06:56 -05:00
|
|
|
let int i = 0;
|
|
|
|
while (i < number_of_messages) {
|
|
|
|
c <| start + i;
|
|
|
|
i += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
log "Check that we don't deadlock.";
|
|
|
|
let port[int] p = port();
|
|
|
|
let task a = spawn "start" start(chan(p), 0, 10);
|
|
|
|
join a;
|
2011-05-12 10:24:54 -05:00
|
|
|
log "Joined task";
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|