Don't fail from kill signals if already unwinding.
This commit is contained in:
parent
bd35798773
commit
92f60f4365
2 changed files with 3 additions and 3 deletions
|
@ -530,13 +530,13 @@ impl Death {
|
||||||
|
|
||||||
/// Fails if a kill signal was received.
|
/// Fails if a kill signal was received.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn check_killed(&self) {
|
pub fn check_killed(&self, already_failing: bool) {
|
||||||
match self.kill_handle {
|
match self.kill_handle {
|
||||||
Some(ref kill_handle) =>
|
Some(ref kill_handle) =>
|
||||||
// The task may be both unkillable and killed if it does some
|
// The task may be both unkillable and killed if it does some
|
||||||
// synchronization during unwinding or cleanup (for example,
|
// synchronization during unwinding or cleanup (for example,
|
||||||
// sending on a notify port). In that case failing won't help.
|
// 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);
|
fail!(KILLED_MSG);
|
||||||
},
|
},
|
||||||
// This may happen during task death (see comments in collect_failure).
|
// This may happen during task death (see comments in collect_failure).
|
||||||
|
|
|
@ -600,7 +600,7 @@ impl Scheduler {
|
||||||
|
|
||||||
// Must happen after running the cleanup job (of course).
|
// Must happen after running the cleanup job (of course).
|
||||||
let task = Local::unsafe_borrow::<Task>();
|
let task = Local::unsafe_borrow::<Task>();
|
||||||
(*task).death.check_killed();
|
(*task).death.check_killed((*task).unwinder.unwinding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue