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

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

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

Definition at line 10 of file ImmutableInterlocked.cs.

10 : class?
11 {
12 Requires.NotNull(transformer, "transformer");
13 T val = Volatile.Read(ref location);
14 bool flag;
15 do
16 {
17 T val2 = transformer(val);
18 if (val == val2)
19 {
20 return false;
21 }
23 flag = val == val3;
24 val = val3;
25 }
26 while (!flag);
27 return true;
28 }
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().