Handle the case where a child task tries to kill a parent while it is dying
Still looks pretty racy
This commit is contained in:
@@ -254,7 +254,7 @@ rust_task::yield(size_t time_in_us) {
|
|||||||
LOG(this, task, "task %s @0x%" PRIxPTR " yielding for %d us",
|
LOG(this, task, "task %s @0x%" PRIxPTR " yielding for %d us",
|
||||||
name, this, time_in_us);
|
name, this, time_in_us);
|
||||||
|
|
||||||
if (killed) {
|
if (killed && !dead()) {
|
||||||
if (blocked()) {
|
if (blocked()) {
|
||||||
unblock();
|
unblock();
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/test/run-pass/lots-a-fail.rs
Normal file
23
src/test/run-pass/lots-a-fail.rs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
// FIXME: Importing std::task doesn't work under check-fast?!
|
||||||
|
// xfail-fast
|
||||||
|
use std;
|
||||||
|
import std::task;
|
||||||
|
import std::comm;
|
||||||
|
import std::uint;
|
||||||
|
|
||||||
|
fn die() {
|
||||||
|
fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn iloop() {
|
||||||
|
task::unsupervise();
|
||||||
|
let f = die;
|
||||||
|
task::spawn(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
for each i in uint::range(0u, 100u) {
|
||||||
|
let f = iloop;
|
||||||
|
task::spawn(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user