问题
Quote from java concurrency in practice:
Using timed lock acquisition to acquire multiple locks can be effective against deadlock even when timed locking is not used consistently throughout the program. If a lock acquisition times out, you can release the locks, back off and wait for a while, and try again, possibly clearing the deadlock condition and allowing the program to recover. (This technique works only when the two locks are acquired together; if multiple locks are acquired due to the nesting of method calls, you cannot just release the outer lock, even if you know you hold it.)
Can you clarify bolded text ?
Maybe it is my translation issue but I don't see explicit difference between 2 and 'multiple' locks and what the problem of nested method calls?
来源:https://stackoverflow.com/questions/42573218/why-timed-lock-technique-doesnt-work-if-multiple-locks-are-acquired-due-to-the