Share via


ImmutableInterlocked.InterlockedExchange<T> 方法

定义

以原子操作的形式将某个数组设置为指定的数组,并返回对原始数组的引用。

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

类型参数

T

数组存储的元素的类型。

参数

location
ImmutableArray<T>

要设置为指定值的数组。

value
ImmutableArray<T>

location 参数要设置成的值。

返回

location 的原始值。

适用于