diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index ffa9e5b7e99..7ef3975fd51 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -254,7 +254,7 @@ rust_task::yield(size_t time_in_us) { LOG(this, task, "task %s @0x%" PRIxPTR " yielding for %d us", name, this, time_in_us); - if (killed) { + if (killed && !dead()) { if (blocked()) { unblock(); } diff --git a/src/test/run-pass/lots-a-fail.rs b/src/test/run-pass/lots-a-fail.rs new file mode 100644 index 00000000000..033f535629d --- /dev/null +++ b/src/test/run-pass/lots-a-fail.rs @@ -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); + } +} \ No newline at end of file