提交完美

This commit is contained in:
PC-20230316NUNE\Administrator
2024-10-17 20:36:24 +08:00
parent 0d600a2786
commit b0a2e4a900
1522 changed files with 40000 additions and 15615 deletions

View File

@@ -0,0 +1,66 @@
namespace JNGame.Runtime.Util.NoThread
{
public class Interlocked
{
public static long Read(ref long location)
{
return location;
}
public static int Increment(ref int location)
{
return location += 1;
}
public static long Increment(ref long location)
{
return location += 1;
}
public static int Decrement(ref int location)
{
return location -= 1;
}
public static long Decrement(ref long location)
{
return location -= 1;
}
public static int Exchange(ref int location, int value)
{
int temp = location;
return location = value;
}
public static long Exchange(ref long location, long value)
{
long temp = location;
return location = value;
}
public static int Add(ref int location, int value)
{
return location += value;
}
public static long Add(ref long location, long value)
{
return location += value;
}
public static int CompareExchange(ref int location, int value, int comparand)
{
if (location == comparand)
{
return location = value;
}
else
{
return location;
}
}
public static long CompareExchange(ref long location, long value, long comparand)
{
if (location == comparand)
{
return location = value;
}
else
{
return location;
}
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a13340b679274363b976467f30806a56
timeCreated: 1720682597