[HLE/Kernel] Fix SetThreadPriority, allow nano seconds values > int.MaxValue, fix on WaitProcessWideKeyAtomic (althrough looks like it still doesn't work properly
This commit is contained in:
parent
62b2124c03
commit
33ae6e544b
6 changed files with 47 additions and 24 deletions
|
@ -12,6 +12,8 @@ namespace Ryujinx.Core.OsHle.Kernel
|
|||
|
||||
private long MutexAddress;
|
||||
|
||||
private int OwnerThreadHandle;
|
||||
|
||||
private List<(KThread Thread, AutoResetEvent WaitEvent)> WaitingThreads;
|
||||
|
||||
public MutualExclusion(Process Process, long MutexAddress)
|
||||
|
@ -24,8 +26,6 @@ namespace Ryujinx.Core.OsHle.Kernel
|
|||
|
||||
public void WaitForLock(KThread RequestingThread)
|
||||
{
|
||||
int OwnerThreadHandle = Process.Memory.ReadInt32(MutexAddress) & ~MutexHasListenersMask;
|
||||
|
||||
WaitForLock(RequestingThread, OwnerThreadHandle);
|
||||
}
|
||||
|
||||
|
@ -80,10 +80,14 @@ namespace Ryujinx.Core.OsHle.Kernel
|
|||
WaitingThreads.RemoveAt(HighestPrioIndex);
|
||||
|
||||
Process.Memory.WriteInt32(MutexAddress, HasListeners | Handle);
|
||||
|
||||
OwnerThreadHandle = Handle;
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Memory.WriteInt32(MutexAddress, 0);
|
||||
|
||||
OwnerThreadHandle = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue