错误:Exception in thread “A” java.lang.IllegalMonitorStateException 如图: 错误原因:使用wait(),notifyAll(),方法没有加锁. 解决:加上synchronized 锁