My code is old code which uses ArrayList
to store elements of collection. I use the m_objects.SyncRoot
for locking purpose before delete the object:
lock(m_objects.SyncRoot)
{
m_objects.Remove(obj);
}
The issue now is, I now want to change the type of m_objects
from ArrayList
to List<T>
, and I encounter problem with the above code. What is the equivalent of List<T>
's SyncRoot
?