diff options
| author | bunnei <bunneidev@gmail.com> | 2021-01-19 21:07:07 -0800 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2021-01-28 21:42:26 -0800 |
| commit | 1f99f5473c7a03c791ea20256c7fc2f1caba8adc (patch) | |
| tree | 3dea03c0082e6685aeda2769fd7b186f0afbf46c /src/core/hle/kernel/k_scheduler_lock.h | |
| parent | c0f5830323ca5d5bdc2e5e494fcaeaf27fffeb6b (diff) | |
kernel: k_light_lock: Simplify EmuThreadHandle implementation.
Diffstat (limited to 'src/core/hle/kernel/k_scheduler_lock.h')
| -rw-r--r-- | src/core/hle/kernel/k_scheduler_lock.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/hle/kernel/k_scheduler_lock.h b/src/core/hle/kernel/k_scheduler_lock.h index 9b40bd22c..5d48dcf38 100644 --- a/src/core/hle/kernel/k_scheduler_lock.h +++ b/src/core/hle/kernel/k_scheduler_lock.h @@ -37,7 +37,7 @@ public: // For debug, ensure that our state is valid. ASSERT(this->lock_count == 0); - ASSERT(this->owner_thread == Core::EmuThreadHandle::InvalidHandle()); + ASSERT(this->owner_thread == EmuThreadHandleInvalid); // Increment count, take ownership. this->lock_count = 1; @@ -54,14 +54,13 @@ public: // We're no longer going to hold the lock. Take note of what cores need scheduling. const u64 cores_needing_scheduling = SchedulerType::UpdateHighestPriorityThreads(kernel); - Core::EmuThreadHandle leaving_thread = owner_thread; // Note that we no longer hold the lock, and unlock the spinlock. - this->owner_thread = Core::EmuThreadHandle::InvalidHandle(); + this->owner_thread = EmuThreadHandleInvalid; this->spin_lock.unlock(); // Enable scheduling, and perform a rescheduling operation. - SchedulerType::EnableScheduling(kernel, cores_needing_scheduling, leaving_thread); + SchedulerType::EnableScheduling(kernel, cores_needing_scheduling); } } @@ -69,7 +68,7 @@ private: KernelCore& kernel; Common::SpinLock spin_lock{}; s32 lock_count{}; - Core::EmuThreadHandle owner_thread{Core::EmuThreadHandle::InvalidHandle()}; + EmuThreadHandle owner_thread{EmuThreadHandleInvalid}; }; } // namespace Kernel |
