(Hopefully) Properly check if the thread is blocked when stepping

This commit is contained in:
svc64 2023-10-07 15:11:51 +03:00
parent 144aa2f5b1
commit f934d23de4

View file

@ -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);