]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
iptv: another improvement in the thread exit procedure, fixes #5550
authorJaroslav Kysela <perex@perex.cz>
Thu, 28 Feb 2019 08:21:40 +0000 (09:21 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 28 Feb 2019 08:21:40 +0000 (09:21 +0100)
src/input/mpegts/iptv/iptv.c

index f34030c2e5fccc0dbddfbc4633a1153012452c4f..78341d159b48ca18e5868c6442865cfd9da040d3 100644 (file)
@@ -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);