From: Jaroslav Kysela Date: Tue, 27 Nov 2018 18:07:15 +0000 (+0100) Subject: tvh thread: fix gtimer_cond timedwait and tvh_cond_init() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b73311c2a816390a41f5f18ff59a40ba74f042c7;p=thirdparty%2Ftvheadend.git tvh thread: fix gtimer_cond timedwait and tvh_cond_init() --- diff --git a/src/main.c b/src/main.c index 3a18bc6cb..12bcb75b4 100644 --- a/src/main.c +++ b/src/main.c @@ -714,7 +714,7 @@ mainloop(void) } /* Wait */ - tvh_cond_timedwait(>imer_cond, &global_lock, (intptr_t )&ts); + tvh_cond_timedwait_ts(>imer_cond, &global_lock, &ts); tvh_mutex_unlock(&global_lock); } } diff --git a/src/tvh_thread.c b/src/tvh_thread.c index a92517b5d..437e30ef7 100644 --- a/src/tvh_thread.c +++ b/src/tvh_thread.c @@ -255,10 +255,12 @@ tvh_cond_init */ r = 0; #else - r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); - if (r) { - fprintf(stderr, "Unable to set monotonic clocks for conditions! (%d)", r); - abort(); + if (monotonic) { + r = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + if (r) { + fprintf(stderr, "Unable to set monotonic clocks for conditions! (%d)", r); + abort(); + } } #endif return pthread_cond_init(&cond->cond, &attr);