← All recipes
Moderne licensed

Use Volatile.Read/Write (SYSLIB0054)

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseVolatileReadWriteArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Replace Thread.VolatileRead and Thread.VolatileWrite with Volatile.Read and Volatile.Write. The Thread methods are obsolete in .NET 9 (SYSLIB0054).

Single recipecsharpdotnetthreadingProprietary

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.Migration.Dotnet.Net9.UseVolatileReadWrite

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet