From f934d23de450508fe2bc8d6244fea9e48d25b7ba Mon Sep 17 00:00:00 2001 From: svc64 Date: Sat, 7 Oct 2023 15:11:51 +0300 Subject: [PATCH] (Hopefully) Properly check if the thread is blocked when stepping --- src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index 1500a9545..501344c79 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -1442,12 +1442,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { lock (_activityOperationLock) { + KernelContext.CriticalSection.Enter(); + bool blocked = MutexOwner != null || WaitingInArbitration || WaitingSync; if (_debugState != (int)DebugState.Stopped || (_forcePauseFlags & ThreadSchedState.ThreadPauseFlag) == 0 - || MutexOwner != null) + || blocked) { + KernelContext.CriticalSection.Leave(); return false; } + KernelContext.CriticalSection.Leave(); Context.RequestDebugStep(); Resume(ThreadSchedState.ThreadPauseFlag);