Skip to content

Commit e321002

Browse files
committed
Use new Lock class
1 parent eccf83b commit e321002

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Foundatio.Mediator/HandlerGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ private static void GenerateGetOrCreateHandler(IndentedStringBuilder source, Han
538538
source.AppendLine()
539539
.AppendLines($$"""
540540
private static {{handler.FullName}}? _handler;
541-
private static readonly object _lock = new object();
541+
private static readonly global::System.Threading.Lock _lock = new();
542542
543543
[DebuggerStepThrough]
544544
private static {{handler.FullName}} GetOrCreateHandler(IServiceProvider serviceProvider)

tests/Foundatio.Mediator.Tests/BasicHandlerGenerationTests.GeneratesWrapperForSimpleHandler.verified.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal static class PingHandler_Ping_Handler
111111
}
112112

113113
private static PingHandler? _handler;
114-
private static readonly object _lock = new object();
114+
private static readonly global::System.Threading.Lock _lock = new();
115115

116116
[DebuggerStepThrough]
117117
private static PingHandler GetOrCreateHandler(IServiceProvider serviceProvider)
@@ -176,4 +176,4 @@ public static class Tests_MediatorHandlers
176176

177177
}
178178
]
179-
}
179+
}

0 commit comments

Comments
 (0)