2010-08-24 23:06:56 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import task;
|
2012-07-25 16:05:06 -05:00
|
|
|
import pipes;
|
|
|
|
import pipes::send;
|
2010-08-24 23:06:56 -05:00
|
|
|
|
2012-07-25 16:05:06 -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-07-30 18:01:07 -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-07-30 18:01:07 -05:00
|
|
|
debug!{"Joined task"};
|
2011-08-12 19:36:52 -05:00
|
|
|
}
|