ConcurrentBag<T>.TryTake(T) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
嘗試從 中移除並返回 ConcurrentBag<T>物件。
public:
virtual bool TryTake([Runtime::InteropServices::Out] T % result);
public bool TryTake(out T result);
abstract member TryTake : 'T -> bool
override this.TryTake : 'T -> bool
Public Function TryTake (ByRef result As T) As Boolean
參數
- result
- T
當此方法回傳時, result 包含從 中移除 ConcurrentBag<T> 的物件,或若袋子為空,則為預設值 T 。
傳回
true如果物品被成功移除;否則,。 false