Skip to content

Commit

Permalink
Performance improvements and allowing for object pooling.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Nov 19, 2022
1 parent 55db62a commit b494c10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AsyncKeyedLock/AsyncKeyedLockReleaser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal AsyncKeyedLockReleaser(TKey key, SemaphoreSlim semaphoreSlim, AsyncKeye
_dictionary = dictionary;
}

public bool TryIncrement()
internal bool TryIncrement()
{
if (Monitor.TryEnter(this))
{
Expand Down
4 changes: 2 additions & 2 deletions AsyncKeyedLock/AsyncKeyedLocker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ public AsyncKeyedLocker(AsyncKeyedLockOptions options, int concurrencyLevel, int
}

/// <summary>
/// Provider for <see cref="IAsyncKeyedLockReleaser{TKey}"/>
/// Provider for <see cref="AsyncKeyedLockReleaser{TKey}"/>
/// </summary>
/// <param name="key">The key for which a releaser should be obtained.</param>
/// <returns>A created or retrieved <see cref="IAsyncKeyedLockReleaser{TKey}"/>.</returns>
/// <returns>A created or retrieved <see cref="AsyncKeyedLockReleaser{TKey}"/>.</returns>
public AsyncKeyedLockReleaser<TKey> GetOrAdd(TKey key) => _dictionary.GetOrAdd(key);
private void Release(AsyncKeyedLockReleaser<TKey> releaser) => _dictionary.Release(releaser);

Expand Down

0 comments on commit b494c10

Please sign in to comment.