From ed51bc173e29cef0cefec309583c314b0f6024ec Mon Sep 17 00:00:00 2001 From: Mark Cilia Vincenti Date: Sat, 12 Oct 2024 19:35:00 +0200 Subject: [PATCH] Switched to the more performant System.Threading.Lock on .NET 9.0+ --- Directory.Build.props | 2 +- .../Codebelt.Extensions.Xunit.Hosting.csproj | 89 ++++++++++--------- .../HostFixture.cs | 2 +- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index edd3089..75ee328 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,7 +6,7 @@ $([MSBuild]::IsOSPlatform('Windows')) true false - latest + preview diff --git a/src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj b/src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj index 491973a..2c292c7 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj +++ b/src/Codebelt.Extensions.Xunit.Hosting/Codebelt.Extensions.Xunit.Hosting.csproj @@ -1,45 +1,52 @@  - - 1e0bdf91-e7c7-4cb4-a39d-e1a5374c5602 - false - - - - The Codebelt.Extensions.Xunit.Hosting namespace contains types that provides a uniform way of doing unit testing used in conjunction with Microsoft Dependency Injection. The namespace relates to the Xunit.Abstractions namespace. - host-test class-fixture host-fixture microsoft dependency injection host configuration hosting-environment service-provider configure-services - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + 1e0bdf91-e7c7-4cb4-a39d-e1a5374c5602 + false + + + + The Codebelt.Extensions.Xunit.Hosting namespace contains types that provides a uniform way of doing unit testing used in conjunction with Microsoft Dependency Injection. The namespace relates to the Xunit.Abstractions namespace. + host-test class-fixture host-fixture microsoft dependency injection host configuration hosting-environment service-provider configure-services + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs b/src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs index af3485a..91ae4f4 100644 --- a/src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs +++ b/src/Codebelt.Extensions.Xunit.Hosting/HostFixture.cs @@ -13,7 +13,7 @@ namespace Codebelt.Extensions.Xunit.Hosting /// public class HostFixture : IDisposable, IHostFixture { - private readonly object _lock = new(); + private readonly Lock _lock = LockFactory.Create(); /// /// Initializes a new instance of the class.