From 59add00d4a37a8f7b1bc8b4c39e46fae35150540 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 22 Jan 2022 21:09:45 -0800 Subject: hle: kernel: KThread: Improve Increment/Decrement RunningThreadCount. - Previously implementation was incorrect, and would occasionally underflow. --- src/core/hle/kernel/k_process.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/core/hle/kernel/k_process.h') diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index c2a672021..38b446350 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h @@ -235,8 +235,8 @@ public: ++schedule_count; } - void IncrementThreadCount(); - void DecrementThreadCount(); + void IncrementRunningThreadCount(); + void DecrementRunningThreadCount(); void SetRunningThread(s32 core, KThread* thread, u64 idle_count) { running_threads[core] = thread; @@ -473,9 +473,7 @@ private: bool is_suspended{}; bool is_initialized{}; - std::atomic num_created_threads{}; - std::atomic num_threads{}; - u16 peak_num_threads{}; + std::atomic num_running_threads{}; std::array running_threads{}; std::array running_thread_idle_counts{}; -- cgit v1.2.3