Use Environment.CurrentManagedThreadId for efficiency

System.Environment.CurrentManagedThreadId is a compact and efficient replacement of the Thread.CurrentThread.ManagedThreadId pattern.
This commit is contained in:
Qstick 2023-01-09 22:15:40 -06:00
parent f928ee7cad
commit af28bbad52
2 changed files with 1 additions and 2 deletions

View File

@ -194,7 +194,6 @@ dotnet_diagnostic.CA1819.severity = suggestion
dotnet_diagnostic.CA1822.severity = suggestion dotnet_diagnostic.CA1822.severity = suggestion
dotnet_diagnostic.CA1823.severity = suggestion dotnet_diagnostic.CA1823.severity = suggestion
dotnet_diagnostic.CA1824.severity = suggestion dotnet_diagnostic.CA1824.severity = suggestion
dotnet_diagnostic.CA1840.severity = suggestion
dotnet_diagnostic.CA1845.severity = suggestion dotnet_diagnostic.CA1845.severity = suggestion
dotnet_diagnostic.CA1846.severity = suggestion dotnet_diagnostic.CA1846.severity = suggestion
dotnet_diagnostic.CA1847.severity = suggestion dotnet_diagnostic.CA1847.severity = suggestion

View File

@ -27,7 +27,7 @@ namespace NzbDrone.Test.Common
public int Start() public int Start()
{ {
int threadId = Thread.CurrentThread.ManagedThreadId; int threadId = Environment.CurrentManagedThreadId;
lock (_mutex) lock (_mutex)
{ {
_threads[threadId] = 1; _threads[threadId] = 1;