有关java多线程中notifyAll()方法的问题
下面是一个有关线程同步问题,notifyAll方法是解除等待线程的阻塞状态,请问里面的阻塞线程是指那些线程?
是请求访问这个方法临界资源的线程吗?
public synchronized void transfer(int from, int to, double amount) throws InterruptedException {
while(accounts[from] < amount)
wait();
System.out.print(Thread.currentThread());
accounts[from] -= amount;
System.out.printf("10.2%f from %d to %d",amount,from,to);
accounts[to] += amount;
System.out.printf("Total Balance: %10.2f\n",getTotalBalance());
notifyAll();
}
谢谢各位指点迷津