Restart socket when able

This commit is contained in:
merry 2022-02-19 15:59:24 +00:00 committed by svc64
parent 1cef40131a
commit 5a34d80f98
1 changed files with 7 additions and 1 deletions

View File

@ -26,6 +26,7 @@ namespace Ryujinx.HLE.Debugger
private BlockingCollection<IMessage> Messages = new BlockingCollection<IMessage>(1);
private Thread SocketThread;
private Thread HandlerThread;
private bool _shuttingDown = false;
private ulong? cThread;
private ulong? gThread;
@ -633,7 +634,10 @@ namespace Ryujinx.HLE.Debugger
{
Logger.Error?.Print(LogClass.GdbStub, ex.ToString());
Logger.Notice.Print(LogClass.GdbStub, "GDB stub socket closed");
return;
if (!_shuttingDown)
{
goto restartListen;
}
}
}
@ -689,6 +693,8 @@ namespace Ryujinx.HLE.Debugger
{
if (disposing)
{
_shuttingDown = true;
if (HandlerThread.IsAlive)
{
Messages.Add(new AbortMessage());