]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api: channel tags - fix ugly mutex bug resulting in wrong channel tag list
authorJaroslav Kysela <perex@perex.cz>
Fri, 4 Sep 2015 14:08:49 +0000 (16:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 4 Sep 2015 14:08:56 +0000 (16:08 +0200)
src/api/api_channel.c

index ef9356132a6975f39d405cd29290e634ef254934..c3f078c19fddcb541e21545825bff26502db1c1c 100644 (file)
@@ -110,6 +110,7 @@ api_channel_tag_list
   char buf[128];
 
   l = htsmsg_create_list();
+  pthread_mutex_lock(&global_lock);
   TAILQ_FOREACH(ct, &channel_tags, ct_link)
     if (cfg || channel_tag_access(ct, perm, 0)) {
       if (ct->ct_enabled) {
@@ -119,6 +120,7 @@ api_channel_tag_list
         api_channel_key_val(l, idnode_uuid_as_str(&ct->ct_id), buf);
       }
     }
+  pthread_mutex_unlock(&global_lock);
   *resp = htsmsg_create_map();
   htsmsg_add_msg(*resp, "entries", l);
   return 0;