Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/MinimalWorker/BackgroundWorkerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ public static partial class BackgroundWorkerExtensions
public static readonly List<WorkerRegistration> _registrations = new();
private static int _registrationCounter = 0;
private static bool _isInitialized = false;
private static readonly object _lock = new();

#if NET9_0_OR_GREATER
private static readonly Lock _lock = new();
#else
private static readonly object _lock = new();
#endif

/// <summary>
/// Internal flag to control whether to use Environment.Exit on validation failure.
Expand Down