Fixes key locking issues#155
Conversation
|
Fixed, @Kukks @NicolasDorier! |
| private static readonly AsyncDuplicateLock _locker = new(); | ||
| private static readonly AsyncKeyedLocker<string> _locker = new(o => | ||
| { | ||
| o.PoolSize = 20; |
There was a problem hiding this comment.
Why do we need these settings? Does this restrict to only 20 concurrent locks?
There was a problem hiding this comment.
No, the pooling is there to improve performance and reduce memory allocations by reusing objects. In case the pool is empty, an object is created. The pool is thus not a restriction.
|
@MarkCiliaVincenti hey, I prefer we don't get a third party dependency for this, can you just copy the relevant classes. |
|
I would need to copy most classes in here, and then what, update this project whenever I update my library? I don't understand what benefit you believe you will get from using 3rd party classes as opposed to a 3rd party dll. If the reason is security, you can step into and debug the code in the NuGet package as I enabled that functionality, which allows you to confirm that what you see in the source code is the same as what is in the DLL. |
|
Do you want this PR closed? |
Fixes race condition mentioned in #148 and also a potential issue when token is cancelled not releasing semaphore during
await Task.Delay(2500, _cts.Token);possibly causing issues.