mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C#: Use dedicated lock type where applicable.
This commit is contained in:
@@ -4,7 +4,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
@@ -264,7 +263,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
|
||||
var isWindows = fileContent.UseWindowsForms || fileContent.UseWpf;
|
||||
|
||||
var sync = new object();
|
||||
var sync = new Lock();
|
||||
var projectGroups = projects.GroupBy(Path.GetDirectoryName);
|
||||
Parallel.ForEach(projectGroups, new ParallelOptions { MaxDegreeOfParallelism = DependencyManager.Threads }, projectGroup =>
|
||||
{
|
||||
@@ -346,7 +345,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
compilationInfoContainer.CompilationInfos.Add(("Fallback nuget restore", notYetDownloadedPackages.Count.ToString()));
|
||||
|
||||
var successCount = 0;
|
||||
var sync = new object();
|
||||
var sync = new Lock();
|
||||
|
||||
Parallel.ForEach(notYetDownloadedPackages, new ParallelOptions { MaxDegreeOfParallelism = DependencyManager.Threads }, package =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user