IDE0044 suggests the field to be readonly, which can't be used together with volatile. https://github.com/dotnet/roslyn/blob/3dc15320d76662294a8544522340823b371efc5c/src/Scripting/CoreTestUtilities/ObjectFormatterFixtures/MockDesktopSpinLock.cs#L18 It seems reasonable that volatile can be omitted. The field is only set in the constructor. How can multiple threads modify it?
Activity
huoyaoyuan commentedon Oct 3, 2020
Already fixed by #43542 .