You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Microsoft.VisualStudio.Threading/AsyncLazy`1.cs
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -384,7 +384,7 @@ public void DisposeValue()
384
384
/// </returns>
385
385
/// <remarks>
386
386
/// <para>Calling this method will put this object into a disposed state where future calls to obtain the value will throw <see cref="ObjectDisposedException"/>.</para>
387
-
/// <para>If the value has already been produced and implements <see cref="IDisposable"/>, <see cref="IAsyncDisposable"/>, or <see cref="System.IAsyncDisposable"/> it will be disposed of.
387
+
/// <para>If the value has already been produced and implements <see cref="IDisposable"/>, <see cref="IAsyncDisposable"/>, or <see cref="System.IAsyncDisposable"/> it will be disposed of.
388
388
/// If the value factory has already started but has not yet completed, its value will be disposed of when the value factory completes.</para>
389
389
/// <para>If prior calls to obtain the value are in flight when this method is called, those calls <em>may</em> complete and their callers may obtain the value, although <see cref="IDisposable.Dispose"/>
390
390
/// may have been or will soon be called on the value, leading those users to experience a <see cref="ObjectDisposedException"/>.</para>
@@ -394,6 +394,7 @@ public void DisposeValue()
394
394
/// </remarks>
395
395
publicasyncTaskDisposeValueAsync()
396
396
{
397
+
JoinableTask<T>?localJoinableTask=null;
397
398
Task<T>?localValueTask=null;
398
399
object?localValue=default;
399
400
lock(this.syncObject)
@@ -417,6 +418,7 @@ public async Task DisposeValueAsync()
417
418
// We'll schedule the value for disposal outside the lock so it can be synchronous with the value factory,
418
419
// but will not execute within our lock.
419
420
localValueTask=this.value;
421
+
localJoinableTask=this.joinableTask;
420
422
break;
421
423
}
422
424
@@ -431,7 +433,11 @@ public async Task DisposeValueAsync()
0 commit comments