From 6ef9d7070168559c9a3140dc5aa40913009a13b7 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 22 Aug 2020 02:55:31 -0700 Subject: [PATCH] name some threads --- Source/Core/Common/WorkQueueThread.h | 3 +++ Source/Core/DolphinQt/DiscordHandler.cpp | 2 ++ Source/Core/DolphinQt/HotkeyScheduler.cpp | 2 ++ Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp | 3 +++ Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp | 3 +++ Source/Core/VideoCommon/AsyncShaderCompiler.cpp | 3 +++ 6 files changed, 16 insertions(+) diff --git a/Source/Core/Common/WorkQueueThread.h b/Source/Core/Common/WorkQueueThread.h index e5dfac8b49..c0a437c168 100644 --- a/Source/Core/Common/WorkQueueThread.h +++ b/Source/Core/Common/WorkQueueThread.h @@ -10,6 +10,7 @@ #include "Common/Event.h" #include "Common/Flag.h" +#include "Common/Thread.h" // A thread that executes the given function for every item placed into its queue. @@ -53,6 +54,8 @@ private: void ThreadLoop() { + Common::SetCurrentThreadName("WorkQueueThread"); + while (true) { m_wakeup.Wait(); diff --git a/Source/Core/DolphinQt/DiscordHandler.cpp b/Source/Core/DolphinQt/DiscordHandler.cpp index ee90692b35..d083814dce 100644 --- a/Source/Core/DolphinQt/DiscordHandler.cpp +++ b/Source/Core/DolphinQt/DiscordHandler.cpp @@ -69,6 +69,8 @@ void DiscordHandler::ShowNewJoinRequest(const std::string& id, const std::string void DiscordHandler::Run() { + Common::SetCurrentThreadName("DiscordHandler"); + while (!m_stop_requested.IsSet()) { Discord::CallPendingCallbacks(); diff --git a/Source/Core/DolphinQt/HotkeyScheduler.cpp b/Source/Core/DolphinQt/HotkeyScheduler.cpp index ec87f5a3fd..190c3a0914 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.cpp +++ b/Source/Core/DolphinQt/HotkeyScheduler.cpp @@ -134,6 +134,8 @@ static void HandleFrameStepHotkeys() void HotkeyScheduler::Run() { + Common::SetCurrentThreadName("HotkeyScheduler"); + while (!m_stop_requested.IsSet()) { Common::SleepCurrentThread(1000 / 60); diff --git a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp index 62febb4c56..76124a97e8 100644 --- a/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp +++ b/Source/Core/InputCommon/ControllerInterface/Win32/Win32.cpp @@ -13,6 +13,7 @@ #include "Common/Event.h" #include "Common/Logging/Log.h" #include "Common/ScopeGuard.h" +#include "Common/Thread.h" #include "InputCommon/ControllerInterface/DInput/DInput.h" #include "InputCommon/ControllerInterface/XInput/XInput.h" @@ -43,6 +44,8 @@ void ciface::Win32::Init(void* hwnd) std::promise message_window_promise; s_thread = std::thread([&message_window_promise] { + Common::SetCurrentThreadName("ciface::Win32 Message Loop"); + HWND message_window = nullptr; Common::ScopeGuard promise_guard([&] { message_window_promise.set_value(message_window); }); diff --git a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp index e51831455e..5c384f6045 100644 --- a/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/CommandBufferManager.cpp @@ -9,6 +9,7 @@ #include "Common/Assert.h" #include "Common/MsgHandler.h" +#include "Common/Thread.h" #include "VideoBackends/Vulkan/VulkanContext.h" @@ -185,6 +186,8 @@ bool CommandBufferManager::CreateSubmitThread() { m_submit_loop = std::make_unique(); m_submit_thread = std::thread([this]() { + Common::SetCurrentThreadName("Vulkan CommandBufferManager SubmitThread"); + m_submit_loop->Run([this]() { PendingCommandBufferSubmit submit; { diff --git a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp index 942f293f1b..1586c7d209 100644 --- a/Source/Core/VideoCommon/AsyncShaderCompiler.cpp +++ b/Source/Core/VideoCommon/AsyncShaderCompiler.cpp @@ -6,6 +6,7 @@ #include #include "Common/Assert.h" #include "Common/Logging/Log.h" +#include "Common/Thread.h" namespace VideoCommon { @@ -192,6 +193,8 @@ void AsyncShaderCompiler::WorkerThreadExit(void* param) void AsyncShaderCompiler::WorkerThreadEntryPoint(void* param) { + Common::SetCurrentThreadName("AsyncShaderCompiler Worker"); + // Initialize worker thread with backend-specific method. if (!WorkerThreadInitWorkerThread(param)) {