diff options
| author | 2022-04-01 18:40:52 -0400 | |
|---|---|---|
| committer | 2022-04-03 21:47:57 -0400 | |
| commit | d6a0666268d5ef51936c2475d33ab37ff14462e4 (patch) | |
| tree | a6410fdd2b4c76de6c4aa8f596b88c2ac18069b2 | |
| parent | kernel: Fix current_process race (diff) | |
| download | yuzu-d6a0666268d5ef51936c2475d33ab37ff14462e4.tar.gz yuzu-d6a0666268d5ef51936c2475d33ab37ff14462e4.tar.xz yuzu-d6a0666268d5ef51936c2475d33ab37ff14462e4.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/kernel/k_process.h | 2 |
1 files changed, 1 insertions, 1 deletions
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: | |||
| 422 | bool is_64bit_process = true; | 422 | bool is_64bit_process = true; |
| 423 | 423 | ||
| 424 | /// Total running time for the process in ticks. | 424 | /// Total running time for the process in ticks. |
| 425 | u64 total_process_running_time_ticks = 0; | 425 | std::atomic<u64> total_process_running_time_ticks = 0; |
| 426 | 426 | ||
| 427 | /// Per-process handle table for storing created object handles in. | 427 | /// Per-process handle table for storing created object handles in. |
| 428 | KHandleTable handle_table; | 428 | KHandleTable handle_table; |