diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs index 3895db3e4d40..f30760981f3a 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs @@ -4,7 +4,6 @@ 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 @@ private void RestoreProjects(IEnumerable projects, out ConcurrentBag { @@ -346,7 +345,7 @@ private void RestoreProjects(IEnumerable projects, out ConcurrentBag { diff --git a/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Options.cs b/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Options.cs index 39c363a77531..64d7535ee2a1 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Options.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Options.cs @@ -1,8 +1,6 @@ +using System; using System.IO; using Semmle.Util; -using Semmle.Util.Logging; -using Semmle.Extraction.CSharp.DependencyFetching; -using System; namespace Semmle.Extraction.CSharp.Standalone { diff --git a/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Program.cs b/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Program.cs index fc13b774f4f1..475847be5765 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Program.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp.Standalone/Program.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using Semmle.Util.Logging; -using Semmle.Extraction.CSharp.DependencyFetching; - namespace Semmle.Extraction.CSharp.Standalone { public class Program diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs index 619eb9953471..262475ca5a16 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/ExtractionContext.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Threading; using Semmle.Util.Logging; using CompilationInfo = (string key, string value); @@ -38,7 +39,7 @@ public ExtractionContext(string cwd, string[] args, string outputPath, IEnumerab // to handle pathological cases. private const int maxErrors = 1000; - private readonly object mutex = new object(); + private readonly Lock mutex = new(); public void Message(Message msg) { diff --git a/csharp/extractor/Semmle.Util/Logging/PidStreamWriter.cs b/csharp/extractor/Semmle.Util/Logging/PidStreamWriter.cs index 7d9599298d65..cf4d8be52e52 100644 --- a/csharp/extractor/Semmle.Util/Logging/PidStreamWriter.cs +++ b/csharp/extractor/Semmle.Util/Logging/PidStreamWriter.cs @@ -1,5 +1,5 @@ using System.IO; -using System.Diagnostics; +using System.Threading; namespace Semmle.Util.Logging { @@ -33,6 +33,6 @@ public override void WriteLine(string? format, params object?[] args) WriteLine(format is null ? format : string.Format(format, args)); } - private readonly object mutex = new object(); + private readonly Lock mutex = new(); } } diff --git a/csharp/extractor/Testrunner/Testrunner.cs b/csharp/extractor/Testrunner/Testrunner.cs index 6280a8c1be2a..d772ca903f7a 100644 --- a/csharp/extractor/Testrunner/Testrunner.cs +++ b/csharp/extractor/Testrunner/Testrunner.cs @@ -14,7 +14,7 @@ /// public class Testrunner { - private static readonly object ConsoleLock = new(); + private static readonly Lock ConsoleLock = new(); private static readonly ManualResetEvent Finished = new(false);