use pthread_mutex_init() and pthread_cond_init() to initialize mutex and condition variable for timeout threads