Share via


ImmutableInterlocked.InterlockedInitialize<T> 方法

定义

如果某个数组尚未初始化,则将该数组设置为指定的数组。

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

类型参数

T

数组存储的元素的类型。

参数

location
ImmutableArray<T>

要设置为指定值的数组。

value
ImmutableArray<T>

location 参数要设置成的值(如果该参数尚未初始化)。

返回

true 如果为数组分配了指定值,则为 ;否则为 false

适用于