From 7d41bbdd2b645655ff8f8bab5237e0df934bbda3 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Wed, 15 Apr 2026 08:23:28 +0200 Subject: [PATCH] Fix Disk Usage thread --- Utilities/Thread.cpp | 7 +++++++ Utilities/Thread.h | 8 ++------ rpcs3/rpcs3qt/game_list_actions.cpp | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 4ec70b58bb..57d7446daf 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -2883,6 +2883,13 @@ void thread_base::exec() } } +void thread_ctrl::set_name(std::string name) +{ + ensure(g_tls_this_thread); + g_tls_this_thread->m_tname.store(make_single(name)); + g_tls_this_thread->set_name(std::move(name)); +} + [[noreturn]] void thread_ctrl::emergency_exit(std::string_view reason) { // Print stacktrace diff --git a/Utilities/Thread.h b/Utilities/Thread.h index 7cd9a7c7ea..bafcea0b9f 100644 --- a/Utilities/Thread.h +++ b/Utilities/Thread.h @@ -129,7 +129,7 @@ public: const native_entry entry_point; // Set name for debugger - static void set_name(std::string); + static void set_name(std::string name); private: // Thread handle (platform-specific) @@ -232,11 +232,7 @@ public: } // Set current thread name (not recommended) - static void set_name(std::string name) - { - g_tls_this_thread->m_tname.store(make_single(name)); - g_tls_this_thread->set_name(std::move(name)); - } + static void set_name(std::string name); // Set thread name (not recommended) template diff --git a/rpcs3/rpcs3qt/game_list_actions.cpp b/rpcs3/rpcs3qt/game_list_actions.cpp index 30b099fb9a..e1a78feb11 100644 --- a/rpcs3/rpcs3qt/game_list_actions.cpp +++ b/rpcs3/rpcs3qt/game_list_actions.cpp @@ -374,7 +374,7 @@ void game_list_actions::ShowDiskUsageDialog() // so run it on a concurrent thread avoiding to block the entire GUI m_disk_usage_future = QtConcurrent::run([this]() { - thread_ctrl::set_name("Disk Usage"); + thread_base::set_name("Disk Usage"); const std::vector> vfs_disk_usage = rpcs3::utils::get_vfs_disk_usage(); const u64 cache_disk_usage = rpcs3::utils::get_cache_disk_usage();