New Rule for C# and VB.NET - Locks should be released!

That is a nice addition. It might be worth to add another rule in this erea:

Non-compliant

private object lock = new object(); // Noncompliant {{lock objects should be read-only.}}

Compliant

private readonly object lock = new object();
3 Likes