说明
1、死锁往往表现为程序的停顿或不再响应用户的要求。从操作系统来看,对应过程的CPU占有率为零,很快就会从top或prstat的输出中消失。
2、java5中加强了对死锁的检测。Java级死锁可直接在线程Dump中报告。
2、实例
Found one Java-level deadlock: ============================= "Thread-1": waiting to lock monitor 0x0003f334 (object 0x22c19f18, a java.lang.Object), which is held by "Thread-0" "Thread-0": waiting to lock monitor 0x0003f314 (object 0x22c19f20, a java.lang.Object), which is held by "Thread-1"
以上就是java中死锁的介绍,希望对大家有所帮助。更多Java学习指路:
本教程操作环境:windows7系统、java5版,DELL G3电脑。