Class ConcurrentDictionaryExtensions
- Namespace
- CounterpointCollective.Threading
- Assembly
- CounterpointCollective.Threading.dll
public static class ConcurrentDictionaryExtensions
- Inheritance
-
ConcurrentDictionaryExtensions
- Inherited Members
Methods
Update<TKey, TValue>(ConcurrentDictionary<TKey, TValue>, TKey, Func<TKey, TValue, TValue>, TValue)
Atomic update. Will retry on concurrent writes.
public static TValue Update<TKey, TValue>(this ConcurrentDictionary<TKey, TValue> d, TKey k, Func<TKey, TValue, TValue> update, TValue v) where TKey : notnull
Parameters
dConcurrentDictionary<TKey, TValue>The dictionary to update.
kTKeyThe key to update.
updateFunc<TKey, TValue, TValue>May be called multiple times on concurrent writes
vTValueThe initial value to check against.
Returns
- TValue
The final value as written into
d
Type Parameters
TKeyTValue