Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
api: channel tags - fix ugly mutex bug resulting in wrong channel tag…
… list
  • Loading branch information
perexg committed Sep 4, 2015
1 parent f4c6817 commit 5079891
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/api/api_channel.c
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit 5079891

Please sign in to comment.