(&amp;mut);
/* modify x and y */
if (x &gt; y) pthread_cond_broadcast(&amp;cond);
pthread_mutex_unlock(&amp;mut);</PRE><BLOCKQUOTE STYLE="margin-left: 3.01cm">
If it can be proved that at most one waiting thread needs to be waken
up (for instance, if there are only two threads communicating through
<I>x</I> and <I>y</I>), <B>pthread_cond_signal</B> can be used as a
slightly more efficient alternative to <B>pthread_cond_broadcast</B>.
If in doubt, use <B>pthread_cond_broadcast</B>. 
</BLOCKQUOTE>
<BLOCKQUOTE