I have a class with a field of type collection.
Questions:
- if I
lock(this), do I effectively lock the collection too? - what is more efficient, to do
lock(this)or to create aSyncRootobject and dolock(SyncRoot)?
I have a class with a field of type collection.
Questions:
lock(this), do I effectively lock the collection too?lock(this) or to create a SyncRoot object and do lock(SyncRoot)?