Use System.Threading.Lock for lock fields
ProprietaryReplace object fields initialized with new object() with System.Threading.Lock initialized with new(). The Lock type provides better performance with the lock statement. Available since .NET 9.
OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLockObjectmod run . --recipe= OpenRewrite. Recipes. CSharp. Migration. Dotnet. Net9. UseLockObjectInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.