Fix #8860: [Win32] Crashlog window wasn't reliably shown for crashes not on the main thread.

This commit is contained in:
Michael Lutz
2021-03-13 21:34:51 +01:00
parent 062eeb9810
commit 13011e00c6
5 changed files with 46 additions and 23 deletions

View File

@@ -11,6 +11,7 @@
#define THREAD_H
#include "debug.h"
#include "crashlog.h"
#include <system_error>
#include <thread>
@@ -47,6 +48,7 @@ inline bool StartNewThread(std::thread *thr, const char *name, TFn&& _Fx, TArgs&
try {
std::thread t([] (const char *name, TFn&& F, TArgs&&... A) {
SetCurrentThreadName(name);
CrashLog::InitThread();
try {
/* Call user function with the given arguments. */
F(A...);