There's no persistant lock. cond_wait releases the lock, allowing other threads to cond_broadcast. cond_wait re-obtains the lock on awakening.
You should reread my node. I added this critical paragraph:
The problem might be that your system's implementation of cond_wait isn't atomic (while it should be), allowing a signal to come in after cond_wait unlocks $baton, but before cond_wait starts waiting.
In reply to Re^9: baton passing threads and cond_signal
by ikegami
in thread baton passing threads and cond_signal
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |