wait()
函数用于在某些设计的条件下让线程等待。
wait()
范例可以参考ThreadCondition.notify()
章节的内容。
wait()
函数会释放线程锁,当被唤醒时重新获取线程锁。
{@fun/Threads/ThreadCondition/notify notify}, {@fun/Threads/ThreadCondition/notifyAll notifyAll}, {@fun/Threads/ThreadCondition/acquire acquire}, {@fun/Threads/ThreadCondition/release release}
notifyAll acquire