ASMPT Interview Question

What method can be used to fix the deadlock problem?