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

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

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

Definition at line 50 of file ImmutableInterlocked.cs.

51 {
52 Requires.NotNull(transformer, "transformer");
53 T[] array = Volatile.Read(ref Unsafe.AsRef(in location.array));
54 bool flag;
55 do
56 {
58 if (array == immutableArray.array)
59 {
60 return false;
61 }
63 flag = array == array2;
64 array = array2;
65 }
66 while (!flag);
67 return true;
68 }
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().