Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting InvalidOperationException for ReadLockAsync (and possibly other methods) #1128

Open
MartyIX opened this issue Dec 16, 2022 · 1 comment

Comments

@MartyIX
Copy link
Contributor

MartyIX commented Dec 16, 2022

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

/// <summary>
/// Obtains a read lock, asynchronously awaiting for the lock if it is not immediately available.
/// </summary>
/// <param name="cancellationToken">
/// A token whose cancellation indicates lost interest in obtaining the lock.
/// A canceled token does not release a lock that has already been issued. But if the lock isn't immediately available,
/// a canceled token will cause the code that is waiting for the lock to resume with an <see cref="OperationCanceledException"/>.
/// </param>
/// <returns>An awaitable object whose result is the lock releaser.</returns>

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

@AArnott
Copy link
Member

AArnott commented Jan 6, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants