ImmutableInterlocked Class

 

Contains interlocked exchange mechanisms for immutable collections.

NuGet package: System.Collections.Immutable (about immutable collections and how to install)

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

System.Object
  System.Collections.Immutable.ImmutableInterlocked

public static class ImmutableInterlocked

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticAddOrUpdate<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, TValue, Func<TKey, TValue, TValue>)

Obtains the value from a dictionary after having added it or updated an existing entry.

System_CAPS_pubmethodSystem_CAPS_staticAddOrUpdate<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, Func<TKey, TValue>, Func<TKey, TValue, TValue>)

Obtains the value from a dictionary after having added it or updated an existing entry.

System_CAPS_pubmethodSystem_CAPS_staticEnqueue<T>(ImmutableQueue<T>, T)

Atomically enqueues an element to the end of a queue.

System_CAPS_pubmethodSystem_CAPS_staticGetOrAdd<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, TValue)

Gets the value for the specified key from the dictionary, or if the key was not found, adds a new value to the dictionary.

System_CAPS_pubmethodSystem_CAPS_staticGetOrAdd<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, Func<TKey, TValue>)

Gets the value for the specified key from the dictionary, or if the key was not found, adds a new value to the dictionary.

System_CAPS_pubmethodSystem_CAPS_staticGetOrAdd<TKey, TValue, TArg>(ImmutableDictionary<TKey, TValue>, TKey, Func<TKey, TArg, TValue>, TArg)

Gets the value for the specified key from the dictionary, or if the key was not found, adds a new value to the dictionary.

System_CAPS_pubmethodSystem_CAPS_staticInterlockedCompareExchange<T>(ImmutableArray<T>, ImmutableArray<T>, ImmutableArray<T>)

System_CAPS_pubmethodSystem_CAPS_staticInterlockedExchange<T>(ImmutableArray<T>, ImmutableArray<T>)

Sets an array to the specified array and returns a reference to the original array, as an atomic operation.

System_CAPS_pubmethodSystem_CAPS_staticInterlockedInitialize<T>(ImmutableArray<T>, ImmutableArray<T>)

Sets an array to the specified array if the array has not been initialized.

System_CAPS_pubmethodSystem_CAPS_staticPush<T>(ImmutableStack<T>, T)

Pushes a new element onto the stack.

System_CAPS_pubmethodSystem_CAPS_staticTryAdd<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, TValue)

Adds the specified key and value to the dictionary if the key is not in the dictionary.

System_CAPS_pubmethodSystem_CAPS_staticTryDequeue<T>(ImmutableQueue<T>, T)

Atomically removes and returns the specified element at the head of the queue, if the queue is not empty.

System_CAPS_pubmethodSystem_CAPS_staticTryPop<T>(ImmutableStack<T>, T)

Removes an element from the top of the stack, if there is an element to remove.

System_CAPS_pubmethodSystem_CAPS_staticTryRemove<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, TValue)

Removes the element with the specified key, if the key exists.

System_CAPS_pubmethodSystem_CAPS_staticTryUpdate<TKey, TValue>(ImmutableDictionary<TKey, TValue>, TKey, TValue, TValue)

Sets the specified key to the specified value if the specified key already is set to a specific value.

This type is thread safe.

Return to top
Show: