So, if the other thread is still busy, and hasn't looped back to its cond_wait(), by the time 'this' thread calls cond_signal(), then when that other thread DOES reach its cond_wait() it'll block.
The threads cannot both hold the lock. One must sit in cond_wait() while the other is working.
In reply to Re^12: Threads sharing global variable (disingenous)
by Anonymous Monk
in thread Threads sharing global variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |