ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Change lock field type to 'System.Threading.Lock'

Last modified: 08 November 2024

Starting from C# 13, in lock statements it is suggested to use a dedicated object instance of the System.Threading.Lock type for the best performance and readability.

This inspection identifies other types used in lock statements and suggests replacing the type of the corresponding field to System.Threading.Lock.