2011-03-25 14:19:20 -05:00
|
|
|
// xfail-stage0
|
2011-07-12 17:27:17 -05:00
|
|
|
|
2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
2011-07-12 17:27:17 -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;
|
2011-07-13 17:44:09 -05:00
|
|
|
}
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> () {
|
|
|
|
log "Check that we don't deadlock.";
|
|
|
|
let port[int] p = port();
|
2011-07-12 17:27:17 -05:00
|
|
|
let task a = spawn start(chan(p), 0, 10);
|
|
|
|
task::join(a);
|
2011-05-12 10:24:54 -05:00
|
|
|
log "Joined task";
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|