Edit

Share via


ImmutableInterlocked.InterlockedCompareExchange<T> Method

Definition

Compares two immutable arrays for equality and, if they are equal, replaces one of the arrays.

public:
generic <typename T>
 static System::Collections::Immutable::ImmutableArray<T> InterlockedCompareExchange(System::Collections::Immutable::ImmutableArray<T> % location, System::Collections::Immutable::ImmutableArray<T> value, System::Collections::Immutable::ImmutableArray<T> comparand);
public static System.Collections.Immutable.ImmutableArray<T> InterlockedCompareExchange<T> (ref System.Collections.Immutable.ImmutableArray<T> location, System.Collections.Immutable.ImmutableArray<T> value, System.Collections.Immutable.ImmutableArray<T> comparand);
static member InterlockedCompareExchange : ImmutableArray * System.Collections.Immutable.ImmutableArray<'T> * System.Collections.Immutable.ImmutableArray<'T> -> System.Collections.Immutable.ImmutableArray<'T>
Public Shared Function InterlockedCompareExchange(Of T) (ByRef location As ImmutableArray(Of T), value As ImmutableArray(Of T), comparand As ImmutableArray(Of T)) As ImmutableArray(Of T)

Type Parameters

T

The type of element stored by the array.

Parameters

location
ImmutableArray<T>

The destination, whose value is compared with comparand and possibly replaced.

value
ImmutableArray<T>

The value that replaces the destination value if the comparison results in equality.

comparand
ImmutableArray<T>

The value that is compared to the value at location.

Returns

The original value in location.

Applies to