2019.4.23
public synchronized void transfer(int from
, int to
, int amount
) throws InterruptedException
{
while(accounts
[from
] < amount
)
wait();
accounts
[from
] -= amount
;
accounts
[to
] += amount
;
notifyAll();
}
转载请注明原文地址:https://ipadbbs.8miu.com/read-16926.html