The unlock-and-block part of cond_wait() is atomic; hence, by the time another thread acquires the lock, this first thread is guaranteed to be in a waiting state.
But if the signalling thread signals before the other thread(s) reach the wait(); that signal can be lost.
In reply to Re^12: Threads sharing global variable
by BrowserUk
in thread Threads sharing global variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |