Skip to content

Commit c69cdee

Browse files
author
Kapil Borle
committed
Remove runspace lock from analysisservice
1 parent 0e5d0dd commit c69cdee

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/PowerShellEditorServices/Analysis/AnalysisService.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ public class AnalysisService : IDisposable
2727

2828
private Runspace analysisRunspace;
2929
private PSModuleInfo scriptAnalyzerModuleInfo;
30-
private Object runspaceLock;
3130
private string[] activeRules;
3231
private string settingsPath;
3332

@@ -67,10 +66,7 @@ public string[] ActiveRules
6766

6867
set
6968
{
70-
lock (runspaceLock)
71-
{
72-
activeRules = value;
73-
}
69+
activeRules = value;
7470
}
7571
}
7672

@@ -86,10 +82,7 @@ public string SettingsPath
8682
}
8783
set
8884
{
89-
lock (runspaceLock)
90-
{
91-
settingsPath = value;
92-
}
85+
settingsPath = value;
9386
}
9487
}
9588

@@ -107,7 +100,6 @@ public AnalysisService(IConsoleHost consoleHost, string settingsPath = null)
107100
{
108101
try
109102
{
110-
this.runspaceLock = new Object();
111103
this.SettingsPath = settingsPath;
112104
this.analysisRunspace = RunspaceFactory.CreateRunspace(InitialSessionState.CreateDefault2());
113105
this.analysisRunspace.ThreadOptions = PSThreadOptions.ReuseThread;

0 commit comments

Comments
 (0)