Closed glen-nicol closed 8 years ago
This is by design in the current implementation, but it will be changed in version 5 to allow multiple Dispose
calls. If you want, you can upgrade to the new version of the coordination primitives now. v5 of Nito.AsyncEx
will depend on that package.
Good to know. Thanks for the quick reply and great work on the library. Very few gotchas and it is very helpful.
I noticed while using the AsyncReaderWriterLock that if I disposed of a lock twice I got undesirable behavior. Namely that if task1 was waiting on the lock and acquired it after the first call to dispose from task0 the second call to Dispose on task0 would release the task1 lock causing it to:
I would like to be able to safely call it twice to write code like this.
I looked at the basic AsyncLock class too and it looks like it suffers from the same design flaw. Namely that the Key classes do not check to see if they have been disposed previously before calling into the lock and releasing things.