hle: kernel: KAbstractSchedulerLock: Various style fixes based on code review feedback.

This commit is contained in:
bunnei 2020-12-05 00:04:24 -08:00
parent 960500cfd2
commit 165d8485f0
1 changed files with 7 additions and 9 deletions

View File

@ -17,16 +17,8 @@ class KernelCore;
template <typename SchedulerType> template <typename SchedulerType>
class KAbstractSchedulerLock { class KAbstractSchedulerLock {
private:
KernelCore& kernel;
Common::SpinLock spin_lock;
s32 lock_count;
Core::EmuThreadHandle owner_thread;
public: public:
KAbstractSchedulerLock(KernelCore& kernel) explicit KAbstractSchedulerLock(KernelCore& kernel) : kernel{kernel} {}
: kernel{kernel}, spin_lock(), lock_count(0),
owner_thread(Core::EmuThreadHandle::InvalidHandle()) {}
bool IsLockedByCurrentThread() const { bool IsLockedByCurrentThread() const {
return this->owner_thread == kernel.GetCurrentEmuThreadID(); return this->owner_thread == kernel.GetCurrentEmuThreadID();
@ -71,6 +63,12 @@ public:
SchedulerType::EnableScheduling(kernel, cores_needing_scheduling, leaving_thread); SchedulerType::EnableScheduling(kernel, cores_needing_scheduling, leaving_thread);
} }
} }
private:
KernelCore& kernel;
Common::SpinLock spin_lock{};
s32 lock_count{};
Core::EmuThreadHandle owner_thread{Core::EmuThreadHandle::InvalidHandle()};
}; };
} // namespace Kernel } // namespace Kernel