vs-threading icon indicating copy to clipboard operation
vs-threading copied to clipboard

Documenting `InvalidOperationException` for `ReadLockAsync` (and possibly other methods)

Open MartyIX opened this issue 3 years ago • 1 comments

I know that AsyncReaderWriterLock has the "completion" feature (i.e. asyncReaderWriterLock.Complete()) but:

https://github.com/microsoft/vs-threading/blob/1738f83f42856926f50820fc49f44d80d2dbbab3/src/Microsoft.VisualStudio.Threading/AsyncReaderWriterLock.cs#L408-L416

is not really helpful in explaining what happens when the AsyncReaderWriterLock.Complete() has been called.

For me it throws: System.InvalidOperationException : This lock has already been marked for completion. No new top-level locks can be serviced.

Would it be worth documening that?

cc @AArnott

MartyIX avatar Dec 16 '22 10:12 MartyIX

Sure. Are you thinking some /// <exception docs on the impacted APIs? If so, would you be interested in sending a PR?

AArnott avatar Jan 06 '23 22:01 AArnott