From 9a3e7b097c9d0153143a5f4ce3fbb245275a7f16 Mon Sep 17 00:00:00 2001 From: rosenkolev1 <50500415+rosenkolev1@users.noreply.github.com> Date: Wed, 18 Mar 2026 09:40:37 +0200 Subject: [PATCH] Make thread TidCounter atomic (#4133) --- src/core/libraries/kernel/threads/pthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libraries/kernel/threads/pthread.cpp b/src/core/libraries/kernel/threads/pthread.cpp index f97451154..3742db5cf 100644 --- a/src/core/libraries/kernel/threads/pthread.cpp +++ b/src/core/libraries/kernel/threads/pthread.cpp @@ -242,7 +242,7 @@ int PS4_SYSV_ABI posix_pthread_create_name_np(PthreadT* thread, const PthreadAtt new_thread->attr.sched_policy = curthread->attr.sched_policy; } - static int TidCounter = 1; + static std::atomic TidCounter = 1; new_thread->tid = ++TidCounter; if (new_thread->attr.stackaddr_attr == nullptr) {