Skip to content

Commit

Permalink
Exposing constructor for AsyncKeyedLockTimeoutReleaser.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Apr 21, 2024
1 parent a2a06e1 commit a550fd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions AsyncKeyedLock/AsyncKeyedLock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
<PackageProjectUrl>https://github.com/MarkCiliaVincenti/AsyncKeyedLock</PackageProjectUrl>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>6.4.1</Version>
<Version>6.4.2</Version>
<PackageIcon>logo.png</PackageIcon>
<PackageReleaseNotes>New methods for conditional locking enabled also for StripedAsyncKeyedLocker and AsyncNonKeyedLocker.</PackageReleaseNotes>
<PackageReleaseNotes>Exposing constructor for AsyncKeyedLockTimeoutReleaser.</PackageReleaseNotes>
<Description>An asynchronous .NET Standard 2.0 library that allows you to lock based on a key (keyed semaphores), limiting concurrent threads sharing the same key to a specified number, with optional pooling for reducing memory allocations.</Description>
<Copyright>© 2024 Mark Cilia Vincenti</Copyright>
<PackageTags>async,lock,key,keyed,semaphore,striped,dictionary,concurrentdictionary,pooling,duplicate,synchronization</PackageTags>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyVersion>6.4.1.0</AssemblyVersion>
<FileVersion>6.4.1.0</FileVersion>
<AssemblyVersion>6.4.2.0</AssemblyVersion>
<FileVersion>6.4.2.0</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsPackable>true</IsPackable>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
Expand Down
7 changes: 6 additions & 1 deletion AsyncKeyedLock/AsyncKeyedLockTimeoutReleaser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ public sealed class AsyncKeyedLockTimeoutReleaser<TKey> : IDisposable
public bool EnteredSemaphore { get; internal set; }
internal readonly AsyncKeyedLockReleaser<TKey> _releaser;

internal AsyncKeyedLockTimeoutReleaser(bool enteredSemaphore, AsyncKeyedLockReleaser<TKey> releaser)
/// <summary>
/// Creates a releaser that only disposes the <see cref="SemaphoreSlim"/> if enteredSemaphore is true.
/// </summary>
/// <param name="enteredSemaphore">If set to true, will dispose the <see cref="SemaphoreSlim"/>.</param>
/// <param name="releaser">The <see cref="AsyncKeyedLockReleaser{TKey}"/> releaser.</param>
public AsyncKeyedLockTimeoutReleaser(bool enteredSemaphore, AsyncKeyedLockReleaser<TKey> releaser)
{
EnteredSemaphore = enteredSemaphore;
_releaser = releaser;
Expand Down

0 comments on commit a550fd3

Please sign in to comment.