neosmart / AsyncLock

An async/await-friendly lock for .NET, complete with asynchronous waits, safe reëntrance, and more.
https://neosmart.net/blog/2017/asynclock-an-asyncawait-friendly-locking-library-for-c-and-net/
MIT License
193 stars 28 forks source link

IAsyncDisposable pattern #15

Closed 0xF6 closed 1 year ago

0xF6 commented 2 years ago

14

0xF6 commented 2 years ago

@mqudsi so, one question in AsyncLock class has member IDisposable Lock and Task<IDisposable> LockAsync which name would be better to take for function returned IAsyncDisposable и Task<IAsyncDisposable>

mqudsi commented 2 years ago

We wouldn’t add a new function to expose that; it would require instead adding a type that implements both IDisposable and IAsyncDisposable, which is unfortunate.