File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/Microsoft.VisualStudio.Threading Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ namespace Microsoft.VisualStudio.Threading
1616 /// </summary>
1717 internal static class JoinableTaskDependencyGraph
1818 {
19+ private static readonly HashSet < IJoinableTaskDependent > EmptySet = new HashSet < IJoinableTaskDependent > ( ) ;
20+
1921 /// <summary>
2022 /// Gets a value indicating whether there is no child depenent item.
2123 /// This method is expected to be used with the JTF lock.
@@ -500,7 +502,13 @@ internal static void OnSynchronousTaskEndToBlockWaiting(JoinableTask syncTask)
500502 lock ( syncTask . Factory . Context . SyncContextLock )
501503 {
502504 // Remove itself from the tracking list, after the task is completed.
503- RemoveDependingSynchronousTask ( syncTask , syncTask , true ) ;
505+ RemoveDependingSynchronousTask ( syncTask , syncTask , force : true ) ;
506+
507+ if ( syncTask . PotentialUnreachableDependents is object && syncTask . PotentialUnreachableDependents . Count > 0 )
508+ {
509+ RemoveUnreachableDependentItems ( syncTask , syncTask . PotentialUnreachableDependents , EmptySet ) ;
510+ syncTask . PotentialUnreachableDependents = null ;
511+ }
504512 }
505513 }
506514 }
You can’t perform that action at this time.
0 commit comments