Closed
Description
If you run this enough times it will eventually fail: (EDIT by bblum: update to new closure syntax & new failure propagation semantics)
fn main() {
for iter::repeat(100u) {
let builder = task::builder();
task::unsupervise(builder);
do task::run(builder) {
let po = comm::port();
let ch = comm::chan(po);
let builder = task::builder();
task::unsupervise(builder);
do task::run(builder) {
comm::send(ch, ());
}
do task::spawn {
fail;
}
comm::recv(po);
}
}
}
rust: fatal, 'task->get_state() == src' failed, ../src/rt/rust_task_thread.cpp:338
The race is between the two tasks, one that wants to unblock the third by killing it, the other by sending a message.