From 80f387d9d1035eba444c28e994ae01ec7782fef6 Mon Sep 17 00:00:00 2001 From: ConfiG Date: Wed, 9 Aug 2023 18:37:26 +0300 Subject: [PATCH] name ipc threads --- loader/src/platform/windows/LoaderImpl.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/loader/src/platform/windows/LoaderImpl.cpp b/loader/src/platform/windows/LoaderImpl.cpp index fe70051c..a3f632eb 100644 --- a/loader/src/platform/windows/LoaderImpl.cpp +++ b/loader/src/platform/windows/LoaderImpl.cpp @@ -101,7 +101,7 @@ void ipcPipeThread(HANDLE pipe) { } void Loader::Impl::setupIPC() { - std::thread([]() { + std::thread ipcThread([]() { while (true) { auto pipe = CreateNamedPipeA( IPC_PIPE_NAME, @@ -125,14 +125,18 @@ void Loader::Impl::setupIPC() { // log::debug("Waiting for pipe connections"); if (ConnectNamedPipe(pipe, nullptr)) { // log::debug("Got connection, creating thread"); - std::thread(&ipcPipeThread, pipe).detach(); + std::thread pipeThread(&ipcPipeThread, pipe); + SetThreadDescription(pipeThread.native_handle(), L"Geode IPC Pipe"); + pipeThread.detach(); } else { // log::debug("No connection, cleaning pipe"); CloseHandle(pipe); } } - }).detach(); + }); + SetThreadDescription(ipcThread.native_handle(), L"Geode Main IPC"); + ipcThread.detach(); log::debug("IPC set up"); }