Suppose I have the two following methods:
Object sync = new Object();
…
public void method1() { lock(sync) { … } }
public void method2() { lock(sync) { method1() … }}
My question here is would this cause any deadlock? Looks like method2 is trying to obtain lock sync when it is already holding it.