In the initialization of the condition variable, there are two options; the first is the use of a feature called
pthread_cond_init
and the second one is to use the PTHREAD_COND_INITIALIZER
macro
that performs a static initialization.
int pthread_cond_init(pthread_cond_t *restrict cond,
const pthread_condattr_t *restrict attr);
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;