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

Add cancellation support to LockAsync #1

Closed dyarkovoy closed 7 years ago

dyarkovoy commented 7 years ago

Also return IDisposable from Lock/LockAsync, as we don't really need to expose any of the InnerLock members. Returning IDisposable makes it more compatible with Stephen Clearly's AsyncLock and other alternatives, providing for easier transition

mqudsi commented 7 years ago

Can you add a unit test that uses the cancellation token routine? The nuget release will be blocking on that.

dyarkovoy commented 7 years ago

sure, just added the PR