]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
imagecache: fix global mutex deadlock
authorJaroslav Kysela <perex@perex.cz>
Fri, 28 Nov 2014 13:20:06 +0000 (14:20 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 28 Nov 2014 13:20:06 +0000 (14:20 +0100)
src/imagecache.c

index 0462474d8a4e9a6aac730b3ed285b11828fca17a..26db0ac0a1992bfc415bb38d2ac83b4a20cb8173 100644 (file)
@@ -144,6 +144,8 @@ imagecache_image_fetch ( imagecache_image_t *img )
   tvhpoll_t *efd = NULL;
   http_client_t *hc;
 
+  lock_assert(&global_lock);
+
   if (img->url == NULL || img->url[0] == '\0')
     return res;
 
@@ -575,9 +577,7 @@ imagecache_open ( uint32_t id )
     } else if (i->state == QUEUED) {
       i->state = FETCHING;
       TAILQ_REMOVE(&imagecache_queue, i, q_link);
-      pthread_mutex_unlock(&global_lock);
       e = imagecache_image_fetch(i);
-      pthread_mutex_lock(&global_lock);
       if (e)
         return -1;
     }