“35be70dfcb3f4b9dfef93a315bbff7fee658bb9e”上不存在“...node/watcher/unix/test/chockidarWatcherService.test.ts”
提交 8012e05c 编写于 作者: H HeeJae Chang

make sure we initialize experimentation service outside of lock since it can jump to other threads.

上级 4d9190ea
......@@ -55,6 +55,16 @@ public class RemoteHostClientService : ForegroundThreadAffinitizedObject, IRemot
public void Enable()
{
// experimentation service unfortunately uses JTF to jump to UI thread in certain cases
// which can cause deadlock if 2 parties try to enable OOP from BG and then FG before
// experimentation service tries to jump to UI thread.
//
// this doesn't attempt to solve our JTF and some services being not free-thread issue here, but
// try to fix this particular deadlock issue only. we already have long discussion on
// how we need to deal with JTF, Roslyn service requirements and VS services reality conflicting
// each others. architectural fix should come from the result of that discussion.
var experimentationService = _workspace.Services.GetService<IExperimentationService>();
lock (_gate)
{
if (_remoteClientTask != null)
......@@ -82,7 +92,7 @@ public void Enable()
}
// set bitness
SetRemoteHostBitness();
SetRemoteHostBitness(experimentationService);
// make sure we run it on background thread
_shutdownCancellationTokenSource = new CancellationTokenSource();
......@@ -176,13 +186,12 @@ public Task<RemoteHostClient> TryGetRemoteHostClientAsync(CancellationToken canc
return remoteClientTask;
}
private void SetRemoteHostBitness()
private void SetRemoteHostBitness(IExperimentationService experimentationService)
{
var x64 = _workspace.Options.GetOption(RemoteHostOptions.OOP64Bit);
if (!x64)
{
x64 = _workspace.Services.GetService<IExperimentationService>().IsExperimentEnabled(
WellKnownExperimentNames.RoslynOOP64bit);
x64 = experimentationService.IsExperimentEnabled(WellKnownExperimentNames.RoslynOOP64bit);
}
// log OOP bitness
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册