Hello
In the above code, the synchronized method a(), when executed, obtains a lock on it's own object. It then calls synchronized method b() which also needs to acquire a lock on it's own object. If
Java did not allow a
thread to reacquire it's own lock method b() would be unable to proceed until method a() completed and released the lock; and method a() would be unable to complete until method b() completed. Result: deadlock
Is it deadlock?
[ October 30, 2007: Message edited by: Jim Yingst ]