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.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp
index 823937443b5..2331cccd590 100644
--- a/src/rt/rust_task.cpp
+++ b/src/rt/rust_task.cpp
@@ -248,7 +248,7 @@ rust_task::kill() {
     killed = true;
     // Unblock the task so it can unwind.
 
-    if (blocked()) {
+    if (blocked() && must_fail_from_being_killed_unlocked()) {
         wakeup(cond);
     }
 
@@ -648,11 +648,13 @@ rust_task::on_rust_stack() {
 
 void
 rust_task::inhibit_kill() {
+    scoped_lock with(kill_lock);
     disallow_kill = true;
 }
 
 void
 rust_task::allow_kill() {
+    scoped_lock with(kill_lock);
     disallow_kill = false;
 }