mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-10 01:06:27 +02:00
Somewhat better scheduler I guess
This commit is contained in:
parent
8df0b62fe0
commit
770cb4b655
10 changed files with 323 additions and 282 deletions
|
@ -1,6 +1,5 @@
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
namespace ChocolArm64.Memory
|
||||
{
|
||||
|
@ -21,32 +20,6 @@ namespace ChocolArm64.Memory
|
|||
}
|
||||
}
|
||||
|
||||
public static int ReadInt32Exclusive(AMemory Memory, long Position)
|
||||
{
|
||||
while (!Memory.AcquireAddress(Position))
|
||||
{
|
||||
Thread.Yield();
|
||||
}
|
||||
|
||||
int Value = Memory.ReadInt32(Position);
|
||||
|
||||
Memory.ReleaseAddress(Position);
|
||||
|
||||
return Value;
|
||||
}
|
||||
|
||||
public static void WriteInt32Exclusive(AMemory Memory, long Position, int Value)
|
||||
{
|
||||
while (!Memory.AcquireAddress(Position))
|
||||
{
|
||||
Thread.Yield();
|
||||
}
|
||||
|
||||
Memory.WriteInt32(Position, Value);
|
||||
|
||||
Memory.ReleaseAddress(Position);
|
||||
}
|
||||
|
||||
public static byte[] ReadBytes(AMemory Memory, long Position, int Size)
|
||||
{
|
||||
byte[] Data = new byte[Size];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue