wait

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}