Skip to content

Commit b63e443

Browse files
committed
Don't lock for dataflow updates
The action block serialises updates, so they won't overlap. There's no race condition with the dispose method either, as the dispose logic just tears down the dataflow links.
1 parent 3e8ae2f commit b63e443

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/LanguageServices/LanguageServiceHost.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices;
3232
[Export(typeof(IWorkspaceWriter))]
3333
[Export(ExportContractNames.Scopes.UnconfiguredProject, typeof(IProjectDynamicLoadComponent))]
3434
[AppliesTo(ProjectCapability.DotNetLanguageService)]
35-
internal sealed class LanguageServiceHost : OnceInitializedOnceDisposedUnderLockAsync, IProjectDynamicLoadComponent, IWorkspaceWriter
35+
internal sealed class LanguageServiceHost : OnceInitializedOnceDisposedAsync, IProjectDynamicLoadComponent, IWorkspaceWriter
3636
{
3737
private readonly TaskCompletionSource _firstPrimaryWorkspaceSet = new();
3838

@@ -130,7 +130,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
130130
// We track per-slice data via this source.
131131
_activeConfigurationGroupSubscriptionService.SourceBlock.SyncLinkOptions(),
132132
target: DataflowBlockFactory.CreateActionBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>>(
133-
async update => await ExecuteUnderLockAsync(cancellationToken => OnSlicesChanged(update, cancellationToken)),
133+
update => OnSlicesChanged(update, cancellationToken),
134134
_unconfiguredProject,
135135
ProjectFaultSeverity.LimitedFunctionality,
136136
"LanguageServiceHostSlices {0}"),
@@ -341,7 +341,7 @@ public async Task AfterLoadInitialConfigurationAsync()
341341
_projectFaultHandler.Forget(result, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
342342
}
343343

344-
protected override Task DisposeCoreUnderLockAsync(bool initialized)
344+
protected override Task DisposeCoreAsync(bool initialized)
345345
{
346346
_firstPrimaryWorkspaceSet.TrySetCanceled();
347347

0 commit comments

Comments
 (0)