Export (0) Print
Expand All

ConcurrentQueue<T>.IsEmpty Property

.NET Framework 4.6 and 4.5

Gets a value that indicates whether the ConcurrentQueue<T> is empty.

Namespace:  System.Collections.Concurrent
Assemblies:   mscorlib (in mscorlib.dll)
  System.Collections.Concurrent (in System.Collections.Concurrent.dll)

public bool IsEmpty { get; }

Property Value

Type: System.Boolean
true if the ConcurrentQueue<T> is empty; otherwise, false.

For determining whether the collection contains any items, use of this property is recommended rather than retrieving the number of items from the Count property and comparing it to 0. However, as this collection is intended to be accessed concurrently, it may be the case that another thread will modify the collection after IsEmpty returns, thus invalidating the result.

.NET Framework

Supported in: 4.6, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1
Show:
© 2015 Microsoft