diff --git a/Common/Thread/ThreadManager.cpp b/Common/Thread/ThreadManager.cpp index 4f60b5b764..0414ee5e79 100644 --- a/Common/Thread/ThreadManager.cpp +++ b/Common/Thread/ThreadManager.cpp @@ -125,7 +125,12 @@ bool ThreadManager::TeardownTask(Task *task, bool enqueue) { static void WorkerThreadFunc(GlobalThreadContext *global, ThreadContext *thread) { char threadName[16]; - snprintf(threadName, sizeof(threadName), "PoolWorker %d", thread->index); + if (thread->type == TaskType::CPU_COMPUTE) { + snprintf(threadName, sizeof(threadName), "PoolWorker %d", thread->index); + } else { + _assert_(thread->type == TaskType::IO_BLOCKING); + snprintf(threadName, sizeof(threadName), "PoolWorkerIO %d", thread->index); + } SetCurrentThreadName(threadName); const bool isCompute = thread->type == TaskType::CPU_COMPUTE; @@ -199,8 +204,8 @@ void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) { thread->cancelled.store(false); thread->private_single.store(nullptr); thread->type = i < numComputeThreads_ ? TaskType::CPU_COMPUTE : TaskType::IO_BLOCKING; - thread->thread = std::thread(&WorkerThreadFunc, global_, thread); thread->index = i; + thread->thread = std::thread(&WorkerThreadFunc, global_, thread); global_->threads_.push_back(thread); } } diff --git a/Common/Thread/ThreadManager.h b/Common/Thread/ThreadManager.h index 5147ad21cc..bd71d8c775 100644 --- a/Common/Thread/ThreadManager.h +++ b/Common/Thread/ThreadManager.h @@ -4,7 +4,7 @@ // The new threadpool. -// To help future smart scheduling. +// To help smart scheduling. enum class TaskType { CPU_COMPUTE, IO_BLOCKING,