← All source files

V16 / 6df58cd3ed86

SemaphoreLease.cs

Lilith/Core/Extensions/SemaphoreLease.cs

Unchanged from the preceding version
CS
namespace Lilith.Core.Extensions;

internal sealed class SemaphoreLease(SemaphoreSlim gate) : IDisposable
{
    private SemaphoreSlim? _gate = gate;
    public void Dispose() => Interlocked.Exchange(ref _gate, null)?.Release();
}