The following program demonstrates the basic use of condition variable using the library calls pthread_cond_wait and pthread_cond_signal.
The complete source cod is available as a zip file.