Deadlocks
A deadlock is a state in which at least one thread is blocked forever because it waits for the release of a resource, it does never get.
There are two main reasons for deadlocks:
- A mutex has not been unlocked.
- You lock your mutexes in a different order.
For overcoming the second issue, techniques such as lock hierachies are used in classical C++.
For the details about deadlocks and how to overcome them with modern C++, read the subsection issues of mutexes and locks.