blob: 6b29ec1ee2a85ebb745344de99cb61f0485fcaee (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
use std;
import std._task;
impure 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" start(chan(p), 0, 10);
join a;
log "Joined Task";
}
|