Using Condition Variables is one way to do it: those are available when using the pthread library under Linux (see link).
A condition variable is a variable of
type pthread_cond_t and is used with
the appropriate functions for waiting
and later, process continuation.