語言

IProducerConsumerCollection<T>.TryTake(T) 方法

定義

嘗試從 中移除並返回 IProducerConsumerCollection<T>物件。

public:
 bool TryTake([Runtime::InteropServices::Out] T % item);
public bool TryTake(out T item);
abstract member TryTake : 'T -> bool
Public Function TryTake (ByRef item As T) As Boolean

參數

item
T

當此方法回傳時,若物件已被移除且成功返回,則 item 包含被移除的物件。 若無物件可移除,該值未指定。

傳回

true如果物品被移除並成功歸還;否則,。 false

適用於

另請參閱