ConcurrentBag<T>.TryTake(T) 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 retourner un objet du 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
Paramètres
- result
- T
Lorsque cette méthode retourne une valeur, result contient l'objet supprimé du ConcurrentBag<T> ou la valeur par défaut de T si le conteneur est vide.
Retours
true si l’objet a été supprimé ; sinon, false.