When two or more threads are waiting for each other to release lock and get stuck for infinite time, situation is called deadlock . It will only happen in case of multitasking.
What is deadlock
原文:http://www.cnblogs.com/zhonghan/p/5010395.html