From: Joel Rosdahl Date: Mon, 15 Sep 2025 19:41:16 +0000 (+0200) Subject: fix: Don't crash thread pool thread if task throws X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e08c366078fdc9b80670156a15373e42ae2c0ce;p=thirdparty%2Fccache.git fix: Don't crash thread pool thread if task throws --- diff --git a/src/ccache/util/threadpool.cpp b/src/ccache/util/threadpool.cpp index 0bc6542b..2257198d 100644 --- a/src/ccache/util/threadpool.cpp +++ b/src/ccache/util/threadpool.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2024 Joel Rosdahl and other contributors +// Copyright (C) 2019-2025 Joel Rosdahl and other contributors // // See doc/AUTHORS.adoc for a complete list of contributors. // @@ -85,7 +85,11 @@ ThreadPool::worker_thread_main() } m_task_popped_condition.notify_all(); - task(); + try { + task(); + } catch (...) { + // We'll have to ignore it for now. + } } }