1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-28 09:56:00 +00:00

Fix a thread sync bug as is the usual...

This commit is contained in:
gdkchan 2018-06-09 22:41:07 -03:00
parent aa75957ce2
commit adeb8793c2

View file

@ -254,7 +254,7 @@ namespace Ryujinx.Core.OsHle.Kernel
WaitThread.MutexAddress = MutexAddress;
WaitThread.CondVarAddress = CondVarAddress;
lock (Process.ThreadArbiterList)
lock (Process.ThreadSyncLock)
{
WaitThread.CondVarSignaled = false;
@ -267,12 +267,18 @@ namespace Ryujinx.Core.OsHle.Kernel
{
Process.Scheduler.EnterWait(WaitThread, NsTimeConverter.GetTimeMs(Timeout));
lock (Process.ThreadArbiterList)
lock (Process.ThreadSyncLock)
{
if (!WaitThread.CondVarSignaled)
WaitThread.MutexOwner?.MutexWaiters.Remove(WaitThread);
if (!WaitThread.CondVarSignaled || WaitThread.MutexOwner != null)
{
WaitThread.MutexOwner = null;
Process.ThreadArbiterList.Remove(WaitThread);
Ns.Log.PrintDebug(LogClass.KernelSvc, "Timed out...");
return false;
}
}
@ -287,7 +293,7 @@ namespace Ryujinx.Core.OsHle.Kernel
private void CondVarSignal(KThread CurrThread, long CondVarAddress, int Count)
{
lock (Process.ThreadArbiterList)
lock (Process.ThreadSyncLock)
{
while (Count == -1 || Count-- > 0)
{