| File: Collections\ConcurrentQueueExtensions.cs | Web Access |
| Project: src\msbuild\src\Build\Microsoft.Build.csproj (Microsoft.Build) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Concurrent; #nullable disable namespace Microsoft.Build.Collections { /// <summary> /// The extensions class for ConcurrentQueue<T> /// </summary> internal static class ConcurrentQueueExtensions { /// <summary> /// The dequeue method. /// </summary> /// <typeparam name="T">The type contained within the queue</typeparam> public static T Dequeue<T>(this ConcurrentQueue<T> stack) where T : class { Assumed.True(stack.TryDequeue(out T result), "Unable to dequeue from queue"); return result; } } }