From: Jaroslav Kysela Date: Thu, 28 Feb 2019 08:21:40 +0000 (+0100) Subject: iptv: another improvement in the thread exit procedure, fixes #5550 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2405f2988ab06d2bafba2b5397cacdac26c0d70;p=thirdparty%2Ftvheadend.git iptv: another improvement in the thread exit procedure, fixes #5550 --- diff --git a/src/input/mpegts/iptv/iptv.c b/src/input/mpegts/iptv/iptv.c index f34030c2e..78341d159 100644 --- a/src/input/mpegts/iptv/iptv.c +++ b/src/input/mpegts/iptv/iptv.c @@ -48,7 +48,7 @@ int iptv_tpool_count = 0; iptv_thread_pool_t *iptv_tpool_last = NULL; gtimer_t iptv_tpool_manage_timer; -static void iptv_input_thread_manage(int count, int force); +static void iptv_input_thread_manage_cb(void *aux); static inline int iptv_tpool_safe_count(void) { @@ -459,7 +459,7 @@ iptv_input_stop_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi ) tvh_mutex_unlock(&iptv_lock); if (u32 == 0) - iptv_input_thread_manage(iptv_tpool_safe_count(), 0); + gtimer_arm_rel(&iptv_tpool_manage_timer, iptv_input_thread_manage_cb, NULL, 0); } static void @@ -1255,6 +1255,12 @@ iptv_input_thread_manage(int count, int force) } } +static void +iptv_input_thread_manage_cb(void *aux) +{ + iptv_input_thread_manage(iptv_tpool_safe_count(), 0); +} + void iptv_init ( void ) { TAILQ_INIT(&iptv_tpool);