Skip to content

Commit

Permalink
Minor optimizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCiliaVincenti committed Sep 21, 2024
1 parent 51e9342 commit ffd45fb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
<PackageProjectUrl>https://github.com/MarkCiliaVincenti/Backport.System.Threading.Lock</PackageProjectUrl>
<Copyright>MIT</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Version>2.0.0</Version>
<Version>2.0.2</Version>
<PackageIcon>logo.png</PackageIcon>
<PackageReleaseNotes>Breaking change that requires different usage for projects targeting frameworks prior to .NET 5.0 in order to cater for potential thread aborts.</PackageReleaseNotes>
<PackageReleaseNotes>Minor optimizations.</PackageReleaseNotes>
<Description>A micro-library that backports .NET 9.0+'s System.Threading.Lock to prior framework versions (from .NET Framework 3.5 up to .NET 8.0), providing as much backward compatibility as possible.</Description>
<Copyright>© 2024 Mark Cilia Vincenti</Copyright>
<PackageTags>System.Threading.Lock,lock,backport,backward,compatible,compatibility,synchronization,synchronisation</PackageTags>
<RepositoryType>git</RepositoryType>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<AssemblyVersion>2.0.2.0</AssemblyVersion>
<FileVersion>2.0.2.0</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IsPackable>true</IsPackable>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisLevel>preview</AnalysisLevel>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>Backport.System.Threading.Lock.snk</AssemblyOriginatorKeyFile>
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
Expand Down
4 changes: 2 additions & 2 deletions Backport.System.Threading.Lock/Lock.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Runtime.CompilerServices;
#if NET5_0_OR_GREATER && !NET9_0_OR_GREATER
using System.Runtime.CompilerServices;

#if NET5_0_OR_GREATER && !NET9_0_OR_GREATER
namespace System.Threading;

/// <summary>
Expand Down
7 changes: 6 additions & 1 deletion Backport.System.Threading.Lock/LockFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FrameworkNamespace = System.Threading;
using System.Runtime.CompilerServices;
using FrameworkNamespace = System.Threading;

namespace Backport.System.Threading;

Expand All @@ -14,6 +15,7 @@ public static class LockFactory
/// If your project does not target anything before .NET 5.0, you do not need to use this; simply use <see cref="FrameworkNamespace.Lock"/>.
/// </summary>
/// <returns>An instance of <see cref="FrameworkNamespace.Lock"/>.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static FrameworkNamespace.Lock Create() => new();
}
#else
Expand All @@ -28,6 +30,9 @@ public static class LockFactory
/// If your project does not target anything before .NET 5.0, you do not need to use this; simply use System.Threading.Lock.
/// </summary>
/// <returns>An instance of <see cref="Lock"/>.</returns>
#if !PRE_NETSTANDARD
[MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif
public static Lock Create() => new();
}
#endif
2 changes: 2 additions & 0 deletions Backport.System.Threading.Lock/PreNet5Lock.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#if !NET9_0_OR_GREATER
using System;
#if !PRE_NETSTANDARD
using System.Runtime.CompilerServices;
#endif
using System.Threading;

namespace Backport.System.Threading;
Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.4" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.25" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="xunit" Version="2.9.0" />
Expand Down

0 comments on commit ffd45fb

Please sign in to comment.