Everyone use lot of List. I need to iterate over this list, so I use the known SyncRoot pattern.
Recently I noticed in this post that the SyncRoot should be avoided
It is actually implemented explicitly.
object ICollection.SyncRoot { get { if (this._syncRoot == null) { Interlocked.CompareExchange(ref this._syncRoot, new object(), null); } return this._syncRoot; } }
This means you must cast to ICollection to use it.
ICollection