mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 23:02:47 +01:00
k_scheduler_lock: Fix data race
TSan reports a race between the main thread and T37 during IsLockedByCurrentThread and when it's set at the end of Lock(), respectively. Set owner_thread to an atomic pointer to fix it. Co-authored-by: bunnei <bunneidev@gmail.com>
This commit is contained in:
parent
e9cf2d43f1
commit
83b86d915a
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include "common/assert.h"
|
||||
#include "core/hle/kernel/k_spin_lock.h"
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
|
@ -75,7 +76,7 @@ private:
|
|||
KernelCore& kernel;
|
||||
KAlignedSpinLock spin_lock{};
|
||||
s32 lock_count{};
|
||||
KThread* owner_thread{};
|
||||
std::atomic<KThread*> owner_thread{};
|
||||
};
|
||||
|
||||
} // namespace Kernel
|
||||
|
|
Loading…
Reference in a new issue