From dd6d73949d5e77e172c48cae29ebb49a7b558668 Mon Sep 17 00:00:00 2001 From: chaoticgd <43898262+chaoticgd@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:20:01 +0000 Subject: [PATCH] DebugTools: Give the symbol guardian worker threads names --- pcsx2/DebugTools/SymbolGuardian.cpp | 11 +++++++---- pcsx2/DebugTools/SymbolGuardian.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pcsx2/DebugTools/SymbolGuardian.cpp b/pcsx2/DebugTools/SymbolGuardian.cpp index 5f2a650b97f58..2d187644598f9 100644 --- a/pcsx2/DebugTools/SymbolGuardian.cpp +++ b/pcsx2/DebugTools/SymbolGuardian.cpp @@ -7,6 +7,7 @@ #include "common/Console.h" #include "common/FileSystem.h" #include "common/StringUtil.h" +#include "common/Threading.h" #include "demangle.h" #include "ccc/ast.h" @@ -15,8 +16,8 @@ #include "ccc/symbol_file.h" #include "DebugInterface.h" -SymbolGuardian R5900SymbolGuardian; -SymbolGuardian R3000SymbolGuardian; +SymbolGuardian R5900SymbolGuardian("EE Symbol Worker"); +SymbolGuardian R3000SymbolGuardian("IOP Symbol Worker"); static void CreateDefaultBuiltInDataTypes(ccc::SymbolDatabase& database); static void CreateBuiltInDataType( @@ -37,11 +38,13 @@ static void error_callback(const ccc::Error& error, ccc::ErrorLevel level) } } -SymbolGuardian::SymbolGuardian() +SymbolGuardian::SymbolGuardian(const char* thread_name) { ccc::set_custom_error_callback(error_callback); - m_import_thread = std::thread([this]() { + m_import_thread = std::thread([this, thread_name]() { + Threading::SetNameOfCurrentThread(thread_name); + while (!m_shutdown_import_thread) { ReadWriteCallback callback; diff --git a/pcsx2/DebugTools/SymbolGuardian.h b/pcsx2/DebugTools/SymbolGuardian.h index dc3d3684cd9fa..f956b8f759319 100644 --- a/pcsx2/DebugTools/SymbolGuardian.h +++ b/pcsx2/DebugTools/SymbolGuardian.h @@ -43,7 +43,7 @@ enum SymbolDatabaseAccessMode struct SymbolGuardian { public: - SymbolGuardian(); + SymbolGuardian(const char* thread_name); SymbolGuardian(const SymbolGuardian& rhs) = delete; SymbolGuardian(SymbolGuardian&& rhs) = delete; ~SymbolGuardian();