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
I know that
AsyncReaderWriterLockhas the "completion" feature (i.e.asyncReaderWriterLock.Complete()) but:vs-threading/src/Microsoft.VisualStudio.Threading/AsyncReaderWriterLock.cs
Lines 408 to 416 in 1738f83
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