<PackageReference Include="Polly" Version="8.6.4" />

BulkheadSemaphoreFactory

using System; using System.Runtime.CompilerServices; using System.Threading; namespace Polly.Bulkhead { internal static class BulkheadSemaphoreFactory { [return: System.Runtime.CompilerServices.Nullable(new byte[] { 0, 1, 1 })] public static (SemaphoreSlim MaxParallelizationSemaphore, SemaphoreSlim MaxQueuedActionsSemaphore) CreateBulkheadSemaphores(int maxParallelization, int maxQueueingActions) { SemaphoreSlim item = new SemaphoreSlim(maxParallelization, maxParallelization); int num = (int)Math.Min((long)maxQueueingActions + (long)maxParallelization, 2147483647); SemaphoreSlim item2 = new SemaphoreSlim(num, num); return (item, item2); } } }