Is lock() type-cast safe?

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-05-15T03:28:28Z Indexed on 2010/05/15 3:34 UTC
Read the original article Hit count: 279

Filed under:
|
public class A { }
public class B:A { }

void foo()
{
   A a = new B();
   B b = a as B;
}

for a given instance setup, will lock(a) be equivalent to lock(b) ?

© Stack Overflow or respective owner

Related posts about locking

Related posts about c#