mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-07 02:38:29 +02:00
Add SvcSetThreadActivity, tweak SignalProcessWideKey, add fmul32i shader instructions and other small fixes
This commit is contained in:
@@ -57,7 +57,7 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||
|
||||
Count = Process.Memory.ReadInt32(CondVarAddress);
|
||||
|
||||
if (Count > 0)
|
||||
if (Result && Count > 0)
|
||||
{
|
||||
Process.Memory.WriteInt32(CondVarAddress, Count - 1);
|
||||
}
|
||||
@@ -73,10 +73,10 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||
{
|
||||
if (Count < 0)
|
||||
{
|
||||
Process.Memory.WriteInt32(CondVarAddress, WaitingThreads.Count);
|
||||
|
||||
foreach ((_, AutoResetEvent WaitEvent) in WaitingThreads)
|
||||
{
|
||||
IncrementCondVarValue();
|
||||
|
||||
WaitEvent.Set();
|
||||
}
|
||||
|
||||
@@ -84,8 +84,6 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||
}
|
||||
else
|
||||
{
|
||||
Process.Memory.WriteInt32(CondVarAddress, Count);
|
||||
|
||||
while (WaitingThreads.Count > 0 && Count-- > 0)
|
||||
{
|
||||
int HighestPriority = WaitingThreads[0].Thread.Priority;
|
||||
@@ -101,6 +99,8 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||
}
|
||||
}
|
||||
|
||||
IncrementCondVarValue();
|
||||
|
||||
WaitingThreads[HighestPrioIndex].WaitEvent.Set();
|
||||
|
||||
WaitingThreads.RemoveAt(HighestPrioIndex);
|
||||
@@ -111,6 +111,17 @@ namespace Ryujinx.Core.OsHle.Kernel
|
||||
Process.Scheduler.Yield(Thread);
|
||||
}
|
||||
|
||||
private void IncrementCondVarValue()
|
||||
{
|
||||
AcquireCondVarValue();
|
||||
|
||||
int Count = Process.Memory.ReadInt32(CondVarAddress);
|
||||
|
||||
Process.Memory.WriteInt32(CondVarAddress, Count + 1);
|
||||
|
||||
ReleaseCondVarValue();
|
||||
}
|
||||
|
||||
private void AcquireCondVarValue()
|
||||
{
|
||||
if (!OwnsCondVarValue)
|
||||
|
Reference in New Issue
Block a user