From 71c0e20f95861a3766c04bc92afe677205848407 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 8 Nov 2022 22:26:14 -0500 Subject: Ensure correctness of atomic store ordering --- src/core/hle/kernel/k_scheduler_lock.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core/hle/kernel/k_scheduler_lock.h') diff --git a/src/core/hle/kernel/k_scheduler_lock.h b/src/core/hle/kernel/k_scheduler_lock.h index 73314b45e..129d60472 100644 --- a/src/core/hle/kernel/k_scheduler_lock.h +++ b/src/core/hle/kernel/k_scheduler_lock.h @@ -60,6 +60,9 @@ public: // Release an instance of the lock. if ((--lock_count) == 0) { + // Perform a memory barrier here. + std::atomic_thread_fence(std::memory_order_seq_cst); + // We're no longer going to hold the lock. Take note of what cores need scheduling. const u64 cores_needing_scheduling = SchedulerType::UpdateHighestPriorityThreads(kernel); -- cgit v1.2.3