]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Don't crash thread pool thread if task throws
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 15 Sep 2025 19:41:16 +0000 (21:41 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 22 Sep 2025 16:56:28 +0000 (18:56 +0200)
src/ccache/util/threadpool.cpp

index 0bc6542b65846a10a93d814eff33abdc5f24e9a2..2257198dcf536df581a0046f6efd4bc61d9ee17b 100644 (file)
@@ -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.
+    }
   }
 }