Table of Contents

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

d ConcurrentDictionary<TKey, TValue>

The dictionary to update.

k TKey

The key to update.

update Func<TKey, TValue, TValue>

May be called multiple times on concurrent writes

v TValue

The initial value to check against.

Returns

TValue

The final value as written into d

Type Parameters

TKey
TValue