mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 00:04:49 +02:00
Common: Fix worker thread names.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user