Java Reference
In-Depth Information
Listing 10.5. Lock-ordering Deadlock Between Cooperating Objects.
Don't do this.
eliminate the deadlock risk. This involves shrinking the
synchronized
blocks to guard
only operations that involve shared state, as in
Listing 10.6
.
Very often, the cause of prob-