这是一种好做法,因为这会减少唤醒之后读线程的等待时间。
This is good practice, because the waiting time of the reader thread is reduced after wake-up.
比如,一个正在等待货物被加入到链表中的线程,当它被唤醒时可能发现链表是空的。
For instance, a thread waiting until items are added to a linked list may wake up to find the list empty.
当它所等待的事件发生时,进程将被显式的唤醒呼叫唤醒。
When the event occurs that it is waiting for, the process is awaken by the explicit wake-up call.
应用推荐