Table of Contents

AsyncSemaphore.Releaser Struct

Definition

Namespace
Bodu.Threading
Assembly
Bodu.Core.dll
Package
Bodu.Core 1.0.1
Source
AsyncSemaphore.Releaser.cs

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

ProductVersions
.NET8, 10