mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Fix shut_down_worker_threads! in presence of panic
This commit is contained in:
parent
8ee88ba7cb
commit
97f252c68b
1 changed files with 7 additions and 5 deletions
|
@ -1776,11 +1776,13 @@ fn load_multi_threaded<'a>(
|
|||
macro_rules! shut_down_worker_threads {
|
||||
() => {
|
||||
for listener in worker_listeners {
|
||||
listener.send(WorkerMsg::Shutdown).map_err(|_| {
|
||||
LoadingProblem::ChannelProblem(
|
||||
ChannelProblem::FailedToSendWorkerShutdownMsg,
|
||||
)
|
||||
})?;
|
||||
// We intentionally don't propagate this Result, because even if
|
||||
// shutting down a worker failed (which can happen if a a panic
|
||||
// occurred on that thread), we want to continue shutting down
|
||||
// the others regardless.
|
||||
if listener.send(WorkerMsg::Shutdown).is_err() {
|
||||
log!("There was an error trying to shutdown a worker thread. One reason this can happen is if the thread panicked.");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue