From d6a0666268d5ef51936c2475d33ab37ff14462e4 Mon Sep 17 00:00:00 2001 From: lat9nq Date: Fri, 1 Apr 2022 18:40:52 -0400 Subject: k_process: Fix data race TSan reported a race between thread 36 and thread 34, a read at :225 and a write at :225 respectively. Make total_proces_running_time_ticks atomic to avoid this race. --- src/core/hle/kernel/k_process.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index 48b17fc74..9f171e3da 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h @@ -422,7 +422,7 @@ private: bool is_64bit_process = true; /// Total running time for the process in ticks. - u64 total_process_running_time_ticks = 0; + std::atomic total_process_running_time_ticks = 0; /// Per-process handle table for storing created object handles in. KHandleTable handle_table; -- cgit v1.2.3