mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-28 00:16:23 +02:00
gdb: Add timeout to prevent deadlock in DebugStep
Deadlock can happen when step at some svc instructions.
This commit is contained in:
parent
e547c4f5f4
commit
bc68502179
1 changed files with 12 additions and 1 deletions
|
@ -1283,7 +1283,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
}
|
}
|
||||||
_kernelContext.CriticalSection.Leave();
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
|
||||||
StepBarrier.SignalAndWait();
|
bool stepTimedOut = false;
|
||||||
|
if (!StepBarrier.SignalAndWait(TimeSpan.FromMilliseconds(2000)))
|
||||||
|
{
|
||||||
|
Logger.Warning?.Print(LogClass.Kernel, $"Failed to step thread {target.ThreadUid} in time.");
|
||||||
|
stepTimedOut = true;
|
||||||
|
}
|
||||||
|
|
||||||
_kernelContext.CriticalSection.Enter();
|
_kernelContext.CriticalSection.Enter();
|
||||||
steppingThread = null;
|
steppingThread = null;
|
||||||
|
@ -1302,6 +1307,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||||
target.Suspend(ThreadSchedState.ThreadPauseFlag);
|
target.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||||
}
|
}
|
||||||
_kernelContext.CriticalSection.Leave();
|
_kernelContext.CriticalSection.Leave();
|
||||||
|
|
||||||
|
if (stepTimedOut)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
StepBarrier.SignalAndWait();
|
StepBarrier.SignalAndWait();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue