共用方式為


ImmutableInterlocked.InterlockedCompareExchange<T> 方法

定義

比較兩個不可變陣列是否相等;如果相等,則取代其中一陣列。

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)

類型參數

T

陣列所儲存的項目類型。

參數

location
ImmutableArray<T>

目的端,其值會與 comparand 進行比較且可能會被取代。

value
ImmutableArray<T>

當比較的結果相等時,會取代目的端值的值。

comparand
ImmutableArray<T>

location 的值比較的值。

傳回

location 中的原始值。

適用於