diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2013-08-02 17:14:56 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2013-08-02 17:31:45 -0400 |
| commit | 92f60f4365beb7b0677b196b1650069bd88cb616 (patch) | |
| tree | 4f4a5f9eafea798a924ac1256f5e081031dfcc64 | |
| parent | bd3579877326fb78ac860f92fc69f4f60bb93012 (diff) | |
| download | rust-92f60f4365beb7b0677b196b1650069bd88cb616.tar.gz rust-92f60f4365beb7b0677b196b1650069bd88cb616.zip | |
Don't fail from kill signals if already unwinding.
| -rw-r--r-- | src/libstd/rt/kill.rs | 4 | ||||
| -rw-r--r-- | src/libstd/rt/sched.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs index 6c450971cdc..deec8dd37a6 100644 --- a/src/libstd/rt/kill.rs +++ b/src/libstd/rt/kill.rs @@ -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). diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs index 5c9b142c052..36b98125229 100644 --- a/src/libstd/rt/sched.rs +++ b/src/libstd/rt/sched.rs @@ -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); } } |
