ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: Inconsistent synchronization on field

Last modified: 21 July 2022

This code inspection warns you about fields being used both with and without locking, thus helping you detect potential problems with thread safety. Here is an example:

The inspection is not triggered on const fields and in private methods that have no synchronization inside but are always used from synchronized contexts.