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-07-27 07:19:39 -05:00
|
|
|
fn start(c: chan[int], start: int, number_of_messages: int) {
|
|
|
|
let i: int = 0;
|
|
|
|
while i < number_of_messages { c <| start + i; i += 1; }
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() {
|
2010-08-24 23:06:56 -05:00
|
|
|
log "Check that we don't deadlock.";
|
2011-07-27 07:19:39 -05:00
|
|
|
let p: port[int] = port();
|
|
|
|
let a: task = spawn start(chan(p), 0, 10);
|
2011-07-12 17:27:17 -05:00
|
|
|
task::join(a);
|
2011-05-12 10:24:54 -05:00
|
|
|
log "Joined task";
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|