about summary refs log tree commit diff
path: root/src/rt/rust_task.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-05-15 14:03:59 -0700
committerBrian Anderson <banderson@mozilla.com>2012-05-15 16:13:42 -0700
commit5d625af9f944c7b6567c443a6f796e30dbb01bf2 (patch)
tree469e7cf76a36fa85f92c37f632e0a3fe4e42c7bc /src/rt/rust_task.cpp
parentc424b7f847bbec50d01b00a89e044d80b8eb59f8 (diff)
downloadrust-5d625af9f944c7b6567c443a6f796e30dbb01bf2.tar.gz
rust-5d625af9f944c7b6567c443a6f796e30dbb01bf2.zip
rt: Make task killing synchronization possibly more correct
I could not come up with a test but this looks better to me.
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;
 }