diff options
| author | bunnei <bunneidev@gmail.com> | 2021-11-25 20:46:17 -0800 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2021-12-06 16:39:17 -0800 |
| commit | abbea575cfcc9e933fbe8f277a5e9f754deb669d (patch) | |
| tree | 50cf06afc61acb947ba8959a33c0e60b74951c1e /src/core/hle/kernel/k_scheduler_lock.h | |
| parent | 2c49a65d2be9cc18bf6e72bb09ad4ce6a8e7588f (diff) | |
hle: kernel: Add a flag for indicating that the kernel is currently shutting down.
Diffstat (limited to 'src/core/hle/kernel/k_scheduler_lock.h')
| -rw-r--r-- | src/core/hle/kernel/k_scheduler_lock.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/hle/kernel/k_scheduler_lock.h b/src/core/hle/kernel/k_scheduler_lock.h index c571f2992..93c47f1b1 100644 --- a/src/core/hle/kernel/k_scheduler_lock.h +++ b/src/core/hle/kernel/k_scheduler_lock.h @@ -23,6 +23,11 @@ public: } void Lock() { + // If we are shutting down the kernel, none of this is relevant anymore. + if (kernel.IsShuttingDown()) { + return; + } + if (IsLockedByCurrentThread()) { // If we already own the lock, we can just increment the count. ASSERT(lock_count > 0); @@ -43,6 +48,11 @@ public: } void Unlock() { + // If we are shutting down the kernel, none of this is relevant anymore. + if (kernel.IsShuttingDown()) { + return; + } + ASSERT(IsLockedByCurrentThread()); ASSERT(lock_count > 0); |
