From: Jaroslav Kysela Date: Tue, 5 Apr 2016 10:58:17 +0000 (+0200) Subject: clocks: update gclk() each second X-Git-Tag: v4.2.1~739 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f6b3dfe035c0a35164752326c7b43731d0c3e0da;p=thirdparty%2Ftvheadend.git clocks: update gclk() each second --- diff --git a/src/main.c b/src/main.c index acf87fa59..4b794e009 100644 --- a/src/main.c +++ b/src/main.c @@ -212,6 +212,7 @@ doexit(int x) if (pthread_self() != main_tid) pthread_kill(main_tid, SIGTERM); pthread_cond_signal(>imer_cond); + tvh_cond_signal(&mtimer_cond, 1); atomic_set(&tvheadend_running, 0); signal(x, doexit); } @@ -531,6 +532,17 @@ show_usage exit(0); } +/** + * + */ +static inline time_t +gdispatch_clock_update(void) +{ + time_t now = time(NULL); + atomic_set_time_t(&__gdispatch_clock, now); + return now; +} + /** * */ @@ -541,6 +553,7 @@ mdispatch_clock_update(void) if (mono > atomic_get_s64(&mtimer_periodic)) { atomic_set_s64(&mtimer_periodic, mono + MONOCLOCK_RESOLUTION); + gdispatch_clock_update(); /* gclk() update */ comet_flush(); /* Flush idle comet mailboxes */ } @@ -623,17 +636,6 @@ mtimer_thread(void *aux) return NULL; } -/** - * - */ -static inline time_t -gdispatch_clock_update(void) -{ - time_t now = time(NULL); - atomic_set_time_t(&__gdispatch_clock, now); - return now; -} - /** * */