threadpool: add panic_handler (#1052)

This commit is contained in:
Ryan Dahl
2019-04-21 16:26:09 -07:00
committed by Carl Lerche
parent 712ca84033
commit fea1f780bc
4 changed files with 55 additions and 0 deletions
+6
View File
@@ -165,6 +165,12 @@ impl Task {
// Transition to the completed state
self.state.store(State::Complete.into(), Release);
if let Err(panic_err) = res {
if let Some(ref f) = unpark.pool.config.panic_handler {
f(panic_err);
}
}
Run::Complete
}
Ok(Ok(Async::NotReady)) => {