What is a deadlock and how might you detect it?

Technical