diff --git a/Source/Core/Common/WorkQueueThread.h b/Source/Core/Common/WorkQueueThread.h index a6cb71b7f9..c3315ac26f 100644 --- a/Source/Core/Common/WorkQueueThread.h +++ b/Source/Core/Common/WorkQueueThread.h @@ -5,6 +5,7 @@ #include #include +#include #include #include "Common/Event.h" @@ -19,8 +20,11 @@ template class WorkQueueThread { public: - WorkQueueThread() = default; - WorkQueueThread(std::function function) { Reset(std::move(function)); } + WorkQueueThread(std::string name) : m_thread_name(name){}; + WorkQueueThread(std::function function, std::string name) : m_thread_name(name) + { + Reset(std::move(function)); + } ~WorkQueueThread() { Shutdown(); } void Reset(std::function function) { @@ -139,7 +143,7 @@ public: private: void ThreadLoop() { - Common::SetCurrentThreadName("WorkQueueThread"); + Common::SetCurrentThreadName(m_thread_name.c_str()); while (true) { @@ -166,6 +170,7 @@ private: } std::function m_function; + std::string m_thread_name; std::thread m_thread; std::mutex m_lock; std::queue m_items; diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceMic.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceMic.cpp index 31de1ddb5a..7aac4177b5 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceMic.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceMic.cpp @@ -200,7 +200,7 @@ CEXIMic::CEXIMic(int index) : slot(index) #ifdef _WIN32 , - m_work_queue([](const std::function& func) { func(); }) + m_work_queue([](const std::function& func) { func(); }, "Mic Worker") #endif { m_position = 0; diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceMic.h b/Source/Core/Core/HW/EXI/EXI_DeviceMic.h index a831ef33e5..937665525b 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceMic.h +++ b/Source/Core/Core/HW/EXI/EXI_DeviceMic.h @@ -102,7 +102,7 @@ private: int samples_avail; #ifdef _WIN32 - Common::WorkQueueThread> m_work_queue; + Common::WorkQueueThread> m_work_queue{"Mic Worker"}; bool m_coinit_success = false; bool m_should_couninit = false; #endif diff --git a/Source/Core/Core/IOS/Network/IP/Top.h b/Source/Core/Core/IOS/Network/IP/Top.h index cc41180860..1e5f86cb29 100644 --- a/Source/Core/Core/IOS/Network/IP/Top.h +++ b/Source/Core/Core/IOS/Network/IP/Top.h @@ -120,7 +120,7 @@ private: IPCReply HandleICMPPingRequest(const IOCtlVRequest& request); Common::SocketContext m_socket_context; - Common::WorkQueueThread m_work_queue; + Common::WorkQueueThread m_work_queue{"Network Worker"}; std::mutex m_async_reply_lock; std::queue m_async_replies; }; diff --git a/Source/Core/Core/IOS/Network/KD/NetKDRequest.h b/Source/Core/Core/IOS/Network/KD/NetKDRequest.h index aae52a11f5..8d2cb9153c 100644 --- a/Source/Core/Core/IOS/Network/KD/NetKDRequest.h +++ b/Source/Core/Core/IOS/Network/KD/NetKDRequest.h @@ -54,7 +54,7 @@ private: NWC24::NWC24Config config; NWC24::NWC24Dl m_dl_list; - Common::WorkQueueThread m_work_queue; + Common::WorkQueueThread m_work_queue{"WiiConnect24 Worker"}; std::mutex m_async_reply_lock; std::queue m_async_replies; // TODO: Maybe move away from Common::HttpRequest? diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 405af72f4a..f045afadb5 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -85,7 +85,7 @@ struct CompressAndDumpState_args static std::mutex s_save_thread_mutex; // Queue for compressing and writing savestates to disk. -static Common::WorkQueueThread s_save_thread; +static Common::WorkQueueThread s_save_thread("Savestate Worker"); // Keeps track of savestate writes that are currently happening, so we don't load a state while // another one is still saving. This is particularly important so if you save to a slot and then diff --git a/Source/Core/DolphinQt/GameList/GameTracker.h b/Source/Core/DolphinQt/GameList/GameTracker.h index 97ec5bb268..1cfd02e62a 100644 --- a/Source/Core/DolphinQt/GameList/GameTracker.h +++ b/Source/Core/DolphinQt/GameList/GameTracker.h @@ -87,7 +87,7 @@ private: // game path -> directories that track it QMap> m_tracked_files; QVector m_tracked_paths; - Common::WorkQueueThread m_load_thread; + Common::WorkQueueThread m_load_thread{"GameList Tracker"}; UICommon::GameFileCache m_cache; Common::Event m_cache_loaded_event; Common::Event m_initial_games_emitted_event;