A complex deadlock is a circular wait involving more than two threads: thread A blocks B, B blocks C, and C blocks A. Longer chains are harder to find, understand, and solve. section 8.2.1
Investigate the thread dump as a chain of blocking relationships:
- Remove threads that are not blocked. section 8.2.1
- Start with a blocked thread and use its waiting lock ID to find what blocks it. section 8.2.1
- Repeat for each thread; returning to an already investigated thread confirms a deadlock. section 8.2.1
- Distinguish cascading blocked threads: their chain ends with an external event rather than a circular lock dependency. section 8.2.1
Three-thread cycle
Thread A holds one lock and waits for a second; thread B holds that second lock and waits for a third; thread C holds the third and waits for A’s lock. The cycle prevents progress. section 8.2.1
