哪位大神再给我解读一下这段程序,谢谢
try { //条件不满足, 将当前线程放入Wait Set lockObj.wait(); } catch (InterruptedException e) { e.printStackTrace(); } } System.out.print(Thread.currentThread().getName()); energyBoxes[from] -= amount; System.out.printf("从%d转移%10.2f单位能量到%d", from, amount, to); energyBoxes[to] += amount; System.out.printf(" 能量总和:%10.2f%n", getTotalEnergies()); //唤醒所有在lockObj对象上等待的线程 lockObj.notifyAll();