summary refs log tree commit diff
path: root/src/test/run-pass/send-iloop.rs
blob: b0003e8b5b18be4a157d125b981a10af5d1a884e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// xfail-win32
extern mod std;

fn die() {
    fail;
}

fn iloop() {
    task::spawn(|| die() );
    let p = comm::Port::<()>();
    let c = comm::Chan(&p);
    loop {
        // Sending and receiving here because these actions yield,
        // at which point our child can kill us
        comm::send(c, ());
        comm::recv(p);
    }
}

fn main() {
    for uint::range(0u, 16u) |_i| {
        task::spawn_unlinked(|| iloop() );
    }
}