• yes gailshaw is correct ,but i like to add that before rectifying your code just understand one thing that there are two kinds of deadlock ,namely cycle deadlock and conversion deadlock be careful while dealing with conversion deadlock because it is not easy to