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

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

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

Definition at line 30 of file ImmutableInterlocked.cs.

30 : class?
31 {
32 Requires.NotNull(transformer, "transformer");
33 T val = Volatile.Read(ref location);
34 bool flag;
35 do
36 {
38 if (val == val2)
39 {
40 return false;
41 }
43 flag = val == val3;
44 val = val3;
45 }
46 while (!flag);
47 return true;
48 }
static int CompareExchange(ref int location1, int value, int comparand)
static bool Read(ref bool location)
Definition Volatile.cs:67

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