mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-11-25 11:35:12 +00:00
Update to new standard for volatility operations (#6682)
This commit is contained in:
parent
2f93ae9a19
commit
22fb8c9d4f
2 changed files with 6 additions and 6 deletions
|
@ -143,7 +143,7 @@ namespace Ryujinx.HLE.HOS
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ControllerKeys pressedKeys = (ControllerKeys)Thread.VolatileRead(ref _pressedKeys);
|
ControllerKeys pressedKeys = (ControllerKeys)Volatile.Read(ref _pressedKeys);
|
||||||
program.Process.TamperedCodeMemory = false;
|
program.Process.TamperedCodeMemory = false;
|
||||||
program.Execute(pressedKeys);
|
program.Execute(pressedKeys);
|
||||||
|
|
||||||
|
@ -175,14 +175,14 @@ namespace Ryujinx.HLE.HOS
|
||||||
{
|
{
|
||||||
if (input.PlayerId == PlayerIndex.Player1 || input.PlayerId == PlayerIndex.Handheld)
|
if (input.PlayerId == PlayerIndex.Player1 || input.PlayerId == PlayerIndex.Handheld)
|
||||||
{
|
{
|
||||||
Thread.VolatileWrite(ref _pressedKeys, (long)input.Buttons);
|
Volatile.Write(ref _pressedKeys, (long)input.Buttons);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear the input because player one is not conected.
|
// Clear the input because player one is not conected.
|
||||||
Thread.VolatileWrite(ref _pressedKeys, 0);
|
Volatile.Write(ref _pressedKeys, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -388,14 +388,14 @@ namespace Ryujinx.Tests.Memory
|
||||||
{
|
{
|
||||||
rwLock.AcquireReaderLock();
|
rwLock.AcquireReaderLock();
|
||||||
|
|
||||||
int originalValue = Thread.VolatileRead(ref value);
|
int originalValue = Volatile.Read(ref value);
|
||||||
|
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
// Spin a bit.
|
// Spin a bit.
|
||||||
for (int i = 0; i < 100; i++)
|
for (int i = 0; i < 100; i++)
|
||||||
{
|
{
|
||||||
if (Thread.VolatileRead(ref readersAllowed) == 0)
|
if (Volatile.Read(ref readersAllowed) == 0)
|
||||||
{
|
{
|
||||||
error = true;
|
error = true;
|
||||||
running = false;
|
running = false;
|
||||||
|
@ -403,7 +403,7 @@ namespace Ryujinx.Tests.Memory
|
||||||
}
|
}
|
||||||
|
|
||||||
// Should not change while the lock is held.
|
// Should not change while the lock is held.
|
||||||
if (Thread.VolatileRead(ref value) != originalValue)
|
if (Volatile.Read(ref value) != originalValue)
|
||||||
{
|
{
|
||||||
error = true;
|
error = true;
|
||||||
running = false;
|
running = false;
|
||||||
|
|
Loading…
Reference in a new issue