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

◆ AddOrUpdate< TKey, TValue >() [1/2]

static TValue System.Collections.Immutable.ImmutableInterlocked.AddOrUpdate< TKey, TValue > ( ref ImmutableDictionary< TKey, TValue > location,
TKey key,
Func< TKey, TValue > addValueFactory,
Func< TKey, TValue, TValue > updateValueFactory )
inlinestatic
Type Constraints
TKey :notnull 

Definition at line 151 of file ImmutableInterlocked.cs.

151 : notnull
152 {
153 Requires.NotNull(addValueFactory, "addValueFactory");
154 Requires.NotNull(updateValueFactory, "updateValueFactory");
156 TValue val;
157 bool flag;
158 do
159 {
160 Requires.NotNull(immutableDictionary, "location");
164 {
165 return value;
166 }
170 }
171 while (!flag);
172 return val;
173 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
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(), System.key, System.Threading.Volatile.Read(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.