mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-27 22:06:24 +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
4ffe38731b
commit
b6f6f8303f
1 changed files with 12 additions and 1 deletions
|
@ -1283,7 +1283,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||
}
|
||||
_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();
|
||||
steppingThread = null;
|
||||
|
@ -1302,6 +1307,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
|||
target.Suspend(ThreadSchedState.ThreadPauseFlag);
|
||||
}
|
||||
_kernelContext.CriticalSection.Leave();
|
||||
|
||||
if (stepTimedOut)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
StepBarrier.SignalAndWait();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue