Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
imagecache: fix global mutex deadlock
  • Loading branch information
perexg committed Nov 28, 2014
1 parent 2ae32e6 commit 1f1b36a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imagecache.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1f1b36a

Please sign in to comment.