added deadlock def and conditions