Deadlocks are another common problem with multithreading. I will explain how you can get into this situation and how to change your code to avoid the problem.