Marc Brooks wrote:
>> to be no major hassle to avoid the entire mess.
>
> +1.
>
> AND if you need a string key (like for a
cache-dependancy key or
> something), I suggest
>
> string objectForLocking = Guid.NewGuid.ToString();
The only downside with both of these is that they don't make
it obvious
from the type itself that the purpose is for locking. That's
one of the
reasons I created a class specifically for locking. Even
without any
extra functionality (i.e. using it just as a reference) I
think there'd
be some point in having a class Lock (or whatever) which
could
optionally take a name. It makes it incredibly obvious what
it's there for.
Jon
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|