Skip to content

Commit

Permalink
Don't fail from kill signals if already unwinding.
Browse files Browse the repository at this point in the history
  • Loading branch information
bblum committed Aug 2, 2013
1 parent bd35798 commit 92f60f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/libstd/rt/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ impl Death {

/// Fails if a kill signal was received.
#[inline]
pub fn check_killed(&self) {
pub fn check_killed(&self, already_failing: bool) {
match self.kill_handle {
Some(ref kill_handle) =>
// The task may be both unkillable and killed if it does some
// synchronization during unwinding or cleanup (for example,
// sending on a notify port). In that case failing won't help.
if self.unkillable == 0 && kill_handle.killed() {
if self.unkillable == 0 && (!already_failing) && kill_handle.killed() {
fail!(KILLED_MSG);
},
// This may happen during task death (see comments in collect_failure).
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/rt/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ impl Scheduler {

// Must happen after running the cleanup job (of course).
let task = Local::unsafe_borrow::<Task>();
(*task).death.check_killed();
(*task).death.check_killed((*task).unwinder.unwinding);
}
}

Expand Down

0 comments on commit 92f60f4

Please sign in to comment.