0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2024-12-22 16:55:49 +00:00

Fix deadlock in background translation thread shutdown (#7239)

TryDequeue checks for _disposed before taking the lock.  If another
thread calls Dispose before it takes the lock, it won't get woken up by
the PulseAll call, and will deadlock in Monitor.Wait.

Double-checking _disposed with the lock taken should avoid this.
This commit is contained in:
David McFarland 2024-08-27 10:10:24 -07:00 committed by GitHub
parent b45a81458a
commit 3c61d560c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -80,7 +80,10 @@ namespace ARMeilleure.Translation
return true;
}
Monitor.Wait(Sync);
if (!_disposed)
{
Monitor.Wait(Sync);
}
}
}