File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 3
3
using System . Diagnostics ;
4
4
using System . IO ;
5
5
using System . Linq ;
6
+ using System . Threading ;
6
7
using System . Threading . Tasks ;
7
8
using Microsoft . CodeAnalysis ;
8
9
using Microsoft . CodeAnalysis . CSharp ;
@@ -23,8 +24,6 @@ public class Analyser : IDisposable
23
24
private protected Entities . Compilation ? compilationEntity ;
24
25
private IDisposable ? compilationTrapFile ;
25
26
26
- private readonly object progressMutex = new object ( ) ;
27
-
28
27
// The bulk of the extraction work, potentially executed in parallel.
29
28
protected readonly List < Action > extractionTasks = new List < Action > ( ) ;
30
29
private int taskCount = 0 ;
@@ -242,8 +241,6 @@ private void DoAnalyseCompilation()
242
241
try
243
242
{
244
243
var assemblyPath = extractor . OutputPath ;
245
-
246
-
247
244
var stopwatch = new Stopwatch ( ) ;
248
245
stopwatch . Start ( ) ;
249
246
var currentTaskId = IncrementTaskCount ( ) ;
@@ -298,10 +295,7 @@ private static void AnalyseNamespace(Context cx, INamespaceSymbol ns)
298
295
299
296
private int IncrementTaskCount ( )
300
297
{
301
- lock ( progressMutex )
302
- {
303
- return ++ taskCount ;
304
- }
298
+ return Interlocked . Increment ( ref taskCount ) ;
305
299
}
306
300
307
301
private void ReportProgressTaskStarted ( int currentCount , string src )
You can’t perform that action at this time.
0 commit comments