Infosys interview question

different types of options to prevent threadlocking