I have a basic threading concept question. Is the code after critical section executed even though critical section is waiting to be executed
object myLock = new Object();
Thread1()
{
lock(myLock)
{
//Code1
}
}
Thread2()
{
lock(myLock)
{
//Code2
}
//Code3
}
Say Code1 is executing. I know Code2 won't execute until Code1 is done. But what about Code3, will that wait for Code2 to execute first? thanks