rust/src/test/run-pass/task-comm-13.rs
2012-08-28 14:33:18 -07:00

17 lines
375 B
Rust

use std;
import task;
import pipes;
import pipes::send;
fn start(c: pipes::Chan<int>, start: int, number_of_messages: int) {
let mut i: int = 0;
while i < number_of_messages { c.send(start + i); i += 1; }
}
fn main() {
debug!("Check that we don't deadlock.");
let (ch, p) = pipes::stream();
task::try(|| start(ch, 0, 10) );
debug!("Joined task");
}