Codechange: Don't use NOT_REACHED() when catching unhandled thread exceptions (#12199)

This commit is contained in:
Loïc Guilloux 2024-03-02 00:07:43 +01:00 committed by GitHub
parent a602845d0a
commit b53d79b1d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include "debug.h"
#include "crashlog.h"
#include "error_func.h"
#include <system_error>
#include <thread>
#include <mutex>
@ -62,6 +63,8 @@ inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs&
try {
/* Call user function with the given arguments. */
F(A...);
} catch (std::exception &e) {
FatalError("Unhandled exception in {} thread: {}", name, e.what());
} catch (...) {
NOT_REACHED();
}