rt: Make task killing synchronization possibly more correct

I could not come up with a test but this looks better to me.
This commit is contained in:
Brian Anderson
2012-05-15 14:03:59 -07:00
parent c424b7f847
commit 5d625af9f9
2 changed files with 12 additions and 4 deletions

View File

@@ -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;
}