2011-09-23 14:30:16 -05:00
|
|
|
// xfail-win32
|
2011-09-16 12:49:41 -05:00
|
|
|
use std;
|
2011-12-13 18:25:51 -06:00
|
|
|
import task;
|
|
|
|
import comm;
|
|
|
|
import uint;
|
2011-09-16 12:49:41 -05:00
|
|
|
|
2012-01-04 23:14:53 -06:00
|
|
|
fn die() {
|
2011-09-16 12:49:41 -05:00
|
|
|
fail;
|
|
|
|
}
|
|
|
|
|
2012-01-04 23:14:53 -06:00
|
|
|
fn iloop() {
|
|
|
|
task::spawn {|| die(); };
|
2011-09-16 12:49:41 -05:00
|
|
|
let p = comm::port::<()>();
|
|
|
|
let c = comm::chan(p);
|
2012-03-09 18:11:56 -06:00
|
|
|
loop {
|
2011-12-01 22:36:03 -06:00
|
|
|
// Sending and receiving here because these actions yield,
|
|
|
|
// at which point our child can kill us
|
2011-09-16 12:49:41 -05:00
|
|
|
comm::send(c, ());
|
2011-12-01 22:36:03 -06:00
|
|
|
comm::recv(p);
|
2011-09-16 12:49:41 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2011-10-21 06:14:28 -05:00
|
|
|
uint::range(0u, 16u) {|_i|
|
2012-04-05 16:09:32 -05:00
|
|
|
let builder = task::builder();
|
2012-02-18 18:34:42 -06:00
|
|
|
task::unsupervise(builder);
|
|
|
|
task::run(builder) {|| iloop(); }
|
2011-10-21 07:12:12 -05:00
|
|
|
}
|
2011-09-16 12:49:41 -05:00
|
|
|
}
|