From 103197bc422b6f1ae9958cc5c6a928d94d3e3366 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 14 Sep 2011 15:26:59 -0700 Subject: Make failure propagation to dead parents work The failure will basically go 'through' the dead parent and continue propagating the failure (as if the child was reparented). --- src/rt/rust_task.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/rt/rust_task.cpp') diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index e99ccc1d04b..bb31e4340a5 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -273,6 +273,7 @@ void rust_task::kill() { if (dead()) { // Task is already dead, can't kill what's already dead. + fail_parent(); return; } @@ -308,6 +309,14 @@ rust_task::conclude_failure() { die(); // Unblock the task so it can unwind. unblock(); + fail_parent(); + failed = true; + notify_tasks_waiting_to_join(); + yield(4); +} + +void +rust_task::fail_parent() { if (supervisor) { DLOG(sched, task, "task %s @0x%" PRIxPTR @@ -318,9 +327,6 @@ rust_task::conclude_failure() { // FIXME: implement unwinding again. if (NULL == supervisor && propagate_failure) sched->fail(); - failed = true; - notify_tasks_waiting_to_join(); - yield(4); } void -- cgit 1.4.1-3-g733a5