Use System.Threading.Lock instead of object for locking
Recipe ID
OpenRewrite.Recipes.CSharp.CodeQuality.Style.FindUseSystemThreadingLockArtifactOpenRewrite.Recipes.CSharp.CodeQualityIn .NET 9+, use System.Threading.Lock instead of object for lock objects. The dedicated Lock type provides better performance.
Single recipecsharpstylecode-qualityProprietary
Usage
This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Style.FindUseSystemThreadingLockIf the recipe isn’t available locally, install it with:
mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality