Przeglądaj źródła

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.
lat9nq 4 lat temu
rodzic
commit
d6a0666268
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      src/core/hle/kernel/k_process.h

+ 1 - 1
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<u64> total_process_running_time_ticks = 0;
 
     /// Per-process handle table for storing created object handles in.
     KHandleTable handle_table;