Skip to content

Don't lock for dataflow updates #8618

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

Merged
merged 1 commit into from
Oct 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices;
[Export(typeof(IWorkspaceWriter))]
[Export(ExportContractNames.Scopes.UnconfiguredProject, typeof(IProjectDynamicLoadComponent))]
[AppliesTo(ProjectCapability.DotNetLanguageService)]
internal sealed class LanguageServiceHost : OnceInitializedOnceDisposedUnderLockAsync, IProjectDynamicLoadComponent, IWorkspaceWriter
internal sealed class LanguageServiceHost : OnceInitializedOnceDisposedAsync, IProjectDynamicLoadComponent, IWorkspaceWriter
{
private readonly TaskCompletionSource _firstPrimaryWorkspaceSet = new();

Expand Down Expand Up @@ -130,7 +130,7 @@ protected override async Task InitializeCoreAsync(CancellationToken cancellation
// We track per-slice data via this source.
_activeConfigurationGroupSubscriptionService.SourceBlock.SyncLinkOptions(),
target: DataflowBlockFactory.CreateActionBlock<IProjectVersionedValue<(ConfiguredProject ActiveConfiguredProject, ConfigurationSubscriptionSources Sources)>>(
async update => await ExecuteUnderLockAsync(cancellationToken => OnSlicesChanged(update, cancellationToken)),
update => OnSlicesChanged(update, cancellationToken),
_unconfiguredProject,
ProjectFaultSeverity.LimitedFunctionality),
linkOptions: DataflowOption.PropagateCompletion,
Expand Down Expand Up @@ -344,7 +344,7 @@ public async Task AfterLoadInitialConfigurationAsync()
_projectFaultHandler.Forget(result, _unconfiguredProject, ProjectFaultSeverity.LimitedFunctionality);
}

protected override Task DisposeCoreUnderLockAsync(bool initialized)
protected override Task DisposeCoreAsync(bool initialized)
{
_firstPrimaryWorkspaceSet.TrySetCanceled();

Expand Down