ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Tente de supprimer et de renvoyer un objet de l’objet 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
Paramètres
- item
- T
Lorsque cette méthode retourne, si l’opération a réussi, item contient l’objet supprimé. Si aucun objet n’a été disponible pour être supprimé, la valeur n’est pas spécifiée.
Retours
true si un élément a été supprimé et retourné avec succès ; sinon, false.
Implémente
Remarques
Pour ConcurrentQueue<T>, cette opération tente de supprimer l’objet du début du ConcurrentQueue<T>.