Is there any reason to lock on something other than new object()?

object theLock = new object();

...


lock (theLock)
{
    ...
}

I always use a new object() for this, but I'm wondering: are there any circumstances in which you would lock on a more specific type?

5
задан Ilya Kogan 19 March 2011 в 09:33
поделиться