Even the lock code snippet in VS 2005 suggests "this" as a default
value. How do they expect people to learn ?

Btw, locking on a string is not a good idea either because since
strings are immutable, they can be shared/interned, thus they may be
publicly accessible too.

Sébastien

On 8/11/06, Peter Ritchie
<[EMAIL PROTECTED]> wrote:
Some references on what is good to lock and what is bad to lock upon:
http://msdn2.microsoft.com/en-us/library/ms228970.aspx
http://msdn2.microsoft.com/en-us/library/c5kehkcz.aspx
http://haacked.com/archive/2005/04/12/2634.aspx

Yes, it's still fairly common to see lock(this), even with sample code
from Microsoft; it's just not suggested...

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



--
Sébastien Lorion
Software Architect / Architecte organique
[EMAIL PROTECTED]

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to