2012-09-18 17:52:21 -05:00
|
|
|
#[legacy_modes];
|
|
|
|
|
2012-09-11 19:46:20 -05:00
|
|
|
extern mod std;
|
2012-09-05 14:32:05 -05:00
|
|
|
use pipes::send;
|
2010-08-24 23:06:56 -05:00
|
|
|
|
2012-08-28 13:11:15 -05:00
|
|
|
fn start(c: pipes::Chan<int>, start: int, number_of_messages: int) {
|
2012-03-22 10:39:41 -05:00
|
|
|
let mut i: int = 0;
|
2012-07-25 16:05:06 -05:00
|
|
|
while i < number_of_messages { c.send(start + i); i += 1; }
|
2010-08-24 23:06:56 -05:00
|
|
|
}
|
|
|
|
|
2011-07-27 07:19:39 -05:00
|
|
|
fn main() {
|
2012-08-22 19:24:52 -05:00
|
|
|
debug!("Check that we don't deadlock.");
|
2012-07-25 16:05:06 -05:00
|
|
|
let (ch, p) = pipes::stream();
|
2012-06-30 18:19:07 -05:00
|
|
|
task::try(|| start(ch, 0, 10) );
|
2012-08-22 19:24:52 -05:00
|
|
|
debug!("Joined task");
|
2011-08-12 19:36:52 -05:00
|
|
|
}
|