AsyncSemaphore.Releaser Struct
Definition
- Assembly
- Bodu.Core.dll
- Package
- Bodu.Core 1.0.1
Represents a permit taken from an AsyncSemaphore. Disposing the releaser returns the permit.
public readonly struct AsyncSemaphore.Releaser : IDisposable
- Implements
- Inherited Members
- Extension Methods
Remarks
The releaser is a lightweight value type returned by LockAsync(). It is intended to be consumed
by a single using statement and disposed exactly once. Copying a releaser and disposing more than one
copy returns more than one permit, which raises the permit count and may throw from Release();
this is undefined behavior, mirroring the contract of the framework's value-type enumerators.
Methods
Dispose()
Returns the permit to the owning AsyncSemaphore.
public void Dispose()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |