Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Update< T, TArg >() [1/2]

static bool System.Collections.Immutable.ImmutableInterlocked.Update< T, TArg > ( ref ImmutableArray< T > location,
Func< ImmutableArray< T >, TArg, ImmutableArray< T > > transformer,
TArg transformerArgument )
inlinestatic

Definition at line 70 of file ImmutableInterlocked.cs.

71 {
72 Requires.NotNull(transformer, "transformer");
73 T[] array = Volatile.Read(ref Unsafe.AsRef(in location.array));
74 bool flag;
75 do
76 {
78 if (array == immutableArray.array)
79 {
80 return false;
81 }
83 flag = array == array2;
84 array = array2;
85 }
86 while (!flag);
87 return true;
88 }
static int CompareExchange(ref int location1, int value, int comparand)
static bool Read(ref bool location)
Definition Volatile.cs:67

References System.array, System.Threading.Interlocked.CompareExchange(), and System.Threading.Volatile.Read().