ConcurrentQueue<T>.IProducerConsumerCollection<T>.TryTake(T) Método
Definição
Tenta remover e retornar um objeto do IProducerConsumerCollection<T>.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
Parâmetros
- item
- T
Quando este método retornar, se a operação tiver sido bem-sucedida, item conterá o objeto removido.When this method returns, if the operation was successful, item contains the object removed. Caso nenhum objeto esteja disponível para ser removido, o valor é não especificado.If no object was available to be removed, the value is unspecified.
Retornos
true se um elemento tiver sido removido e tiver retornado com êxito; caso contrário, false.true if an element was removed and returned successfully; otherwise, false.
Implementações
Comentários
Para o ConcurrentQueue<T> , essa operação tentará remover o objeto do início do ConcurrentQueue<T> .For ConcurrentQueue<T>, this operation will attempt to remove the object from the beginning of the ConcurrentQueue<T>.