rust/src/test/run-pass/task-comm-13.rs

20 lines
387 B
Rust
Raw Normal View History

// xfail-stage0
use std;
import std::task;
2011-04-19 15:35:49 -05:00
fn start(chan[int] c, int start, int number_of_messages) {
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(chan(p), 0, 10);
task::join(a);
log "Joined task";
}