Skip to content

Commit

Permalink
DebugTools: Give the symbol guardian worker threads names
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Mar 11, 2024
1 parent 0c92e1f commit dd6d739
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions pcsx2/DebugTools/SymbolGuardian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/DebugTools/SymbolGuardian.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit dd6d739

Please sign in to comment.