Skip to content

Commit 92f60f4

Browse files
committed
Don't fail from kill signals if already unwinding.
1 parent bd35798 commit 92f60f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/libstd/rt/kill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,13 @@ impl Death {
530530

531531
/// Fails if a kill signal was received.
532532
#[inline]
533-
pub fn check_killed(&self) {
533+
pub fn check_killed(&self, already_failing: bool) {
534534
match self.kill_handle {
535535
Some(ref kill_handle) =>
536536
// The task may be both unkillable and killed if it does some
537537
// synchronization during unwinding or cleanup (for example,
538538
// sending on a notify port). In that case failing won't help.
539-
if self.unkillable == 0 && kill_handle.killed() {
539+
if self.unkillable == 0 && (!already_failing) && kill_handle.killed() {
540540
fail!(KILLED_MSG);
541541
},
542542
// This may happen during task death (see comments in collect_failure).

src/libstd/rt/sched.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ impl Scheduler {
600600

601601
// Must happen after running the cleanup job (of course).
602602
let task = Local::unsafe_borrow::<Task>();
603-
(*task).death.check_killed();
603+
(*task).death.check_killed((*task).unwinder.unwinding);
604604
}
605605
}
606606

0 commit comments

Comments
 (0)