路在脚下,心向远方

死锁

[TOC] 线程死锁 代码显示 public class DealLock implements Runnable { private Object Alock = new Object(); private Object Block = new Object(); @Override public void run() { String name = Thread.currentThread().getName(); if ("A".equals(name)) { a(); } else { b(); } } public void a() { synchronized (Alock) { System.out.printl