From 5d625af9f944c7b6567c443a6f796e30dbb01bf2 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 15 May 2012 14:03:59 -0700 Subject: rt: Make task killing synchronization possibly more correct I could not come up with a test but this looks better to me. --- src/rt/rust_task.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/rt/rust_task.cpp') 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; } -- cgit 1.4.1-3-g733a5