Pregunta de entrevista de ASMPT

What method can be used to fix the deadlock problem?