In your particular situation the condition is never going to be signalled. Just declare one in the pause() function, something along the lines of
void pause_thread(struct timespec * wakeuptime)
{
pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
pthread_mutex_t mx = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_lock(&mx);
while(pthread_cond_timedwait(&cond, &mx, wakeuptime) != ETIMEDOUT)
;
pthread_mutex_unlock(&mx);
pthread_cond_destroy(&cond);
pthread_mutex_destroy(&mx);
}
This is a demo. Of course you may want to have cond and mx to be created once and destroyed once.> just have limited knowledge when it comes to mutexes and conditions
That's OK. You want to learn, don't you?