摘要: 内置锁是可重入的,因此一个线程试图获取一个本来由他自己持有的锁,请求就会成功public class Test { public synchronized void getLock(){ System.out.println("lock"); this.getAgain(); } public synchronized void getAgain(){ System.out.println("again"); } public static void main(String[] args) { Test t = new Test(); t.getLock 阅读全文
posted @ 2013-04-12 16:06 心意合一 阅读(143) 评论(0) 推荐(0) 编辑