デッドロック (deadlock) は、2 つ以上のスレッドがそれぞれ 永遠にブロック され、各々が他が保持するリソースを待っている状態です。何も進みません。
4 つの必要 (Coffman) 条件
4 つすべてが同時に成り立たねばなりません — どれか 1 つを取り除けばデッドロックは不可能です:
text
1. Mutual exclusion → a resource is held exclusively (only one holder at a time)
2. Hold and wait → a thread holds one resource while waiting to acquire another
3. No preemption → resources can't be forcibly taken; only released voluntarily
4. Circular wait → a cycle: T1 waits for R2 (held by T2), T2 waits for R1 (held by T1)
