about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_task.cpp')
-rw-r--r--src/rt/rust_task.cpp12
1 files changed, 9 insertions, 3 deletions
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