zJun's Tech Weblog
posted on 2007-07-24 19:02 zJun's帛罗阁 阅读(3218) 评论(1) 编辑 收藏 所属分类: Java基础
synchronized (shareObj1) { System.out.println(threadName + " locked for shareObj1 " ); } Thread.sleep( 1000 ); synchronized (shareObj1) { System.out.println(threadName + " locked for shareObj2 " ); } 代码错了吧!这会死锁吗? 第二个是2并且new 2时顺序颠倒 回复 更多评论