UC3M

Telematic/Audiovisual Syst./Communication Syst. Engineering

Systems Architecture

September 2015 - January 2016

11.4.6.  Signaling

Finally, signaling functionality completes pthread_cond_wait functionality. The first option there is to signal to one individual threads blocked on a pthread_cond_wait. A peculiarity of this operation is that if there is not any threads blocked on the condition variable, then the signal is lost.

 int pthread_cond_signal(pthread_cond_t *cond);

Another useful feature allows you to wake up all threads that are blocked on a condition variable, signaling an operation by flooding (i.e. broadcasting):

 int pthread_cond_broadcast(pthread_cond_t *cond);