summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/k_scheduler_lock.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-11-26 05:46:17 +0100
committerbunnei <bunneidev@gmail.com>2021-12-07 01:39:17 +0100
commitabbea575cfcc9e933fbe8f277a5e9f754deb669d (patch)
tree50cf06afc61acb947ba8959a33c0e60b74951c1e /src/core/hle/kernel/k_scheduler_lock.h
parenthle: kernel: KSynchronizationObject: Fix variable shadowing. (diff)
downloadyuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar.gz
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar.bz2
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar.lz
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar.xz
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.tar.zst
yuzu-abbea575cfcc9e933fbe8f277a5e9f754deb669d.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/kernel/k_scheduler_lock.h10
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);