ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake(T) Methode
Definition
Versucht, ein Objekt aus der IProducerConsumerCollection<T> zu entfernen und zurückzugeben.Attempts to remove and return an object from the IProducerConsumerCollection<T>.
virtual bool System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake([Runtime::InteropServices::Out] T % item) = System::Collections::Concurrent::IProducerConsumerCollection<T>::TryTake;
bool IProducerConsumerCollection<T>.TryTake (out T item);
abstract member System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake : 'T -> bool
override this.System.Collections.Concurrent.IProducerConsumerCollection<T>.TryTake : 'T -> bool
Function TryTake (ByRef item As T) As Boolean Implements IProducerConsumerCollection(Of T).TryTake
Parameter
- item
- T
Wenn diese Methode beendet wird und der Vorgang erfolgreich war, enthält item
das entfernte Objekt.When this method returns, if the operation was successful, item
contains the object removed. Wenn kein Objekt zum Entfernen verfügbar war, ist der Wert nicht angegeben.If no object was available to be removed, the value is unspecified.
Gibt zurück
true
, wenn ein Element entfernt und erfolgreich zurückgegeben wurde, andernfalls false
.true
if an element was removed and returned successfully; otherwise, false
.
Implementiert
Hinweise
Für ConcurrentQueue<T> wird mit diesem Vorgang versucht, das-Objekt vom Anfang der zu entfernen ConcurrentQueue<T> .For ConcurrentQueue<T>, this operation will attempt to remove the object from the beginning of the ConcurrentQueue<T>.