<PackageReference Include="Microsoft.Identity.Client" Version="4.84.0" />

Microsoft.Identity.Client.PlatformsCommon.Shared.KeyedSemaphorePool

sealed class KeyedSemaphorePool
Provides per-key async gates using SemaphoreSlim. Call EnterAsync and ensure Release is called in a finally block. Semaphores are kept for the lifetime of the pool; we do not remove or dispose them per key to avoid races with concurrent callers.

public Task EnterAsync(string key, CancellationToken cancellationToken)

Enters the gate for key. Await and pair with Release.

public void Release(string key)

Releases the gate for key. Safe to call even if the key is missing; a missing key is a no-op.