Java Reference
In-Depth Information
Listing 10.3. Inducing a Lock Ordering to Avoid Deadlock.
If
Account
has a unique, immutable, comparable key such as an account number, inducing
a lock ordering is even easier: order objects by their key, thus eliminating the need for the
tie-breaking lock.