Use System.Threading.Lock for lock fields

Proprietary

Replace 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.UseLockObject
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseLockObject

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.