]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
capmt: fix the mutex deadlock in capmt_destroy()
authorJaroslav Kysela <perex@perex.cz>
Mon, 9 Jun 2014 17:12:01 +0000 (19:12 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 10 Jun 2014 12:02:37 +0000 (14:02 +0200)
src/descrambler/capmt.c

index 897b614c38376ba888aec3857cc57f0ccd1ba31c..382223f1cd7bf6d3d25f4b6d6378111cef717c02 100644 (file)
@@ -1775,6 +1775,7 @@ capmt_destroy(capmt_t *capmt)
   TAILQ_REMOVE(&capmts, capmt, capmt_link);  
   capmt->capmt_running = 0;
   pthread_cond_signal(&capmt->capmt_cond);
+  pthread_mutex_unlock(&global_lock);
   pthread_join(capmt->capmt_tid, NULL);
   free(capmt->capmt_sockfile);
   capmt->capmt_sockfile = NULL;
@@ -1784,6 +1785,7 @@ capmt_destroy(capmt_t *capmt)
          capmt->capmt_oscam,
          capmt->capmt_oscam == CAPMT_OSCAM_TCP ? "IP address" : "sockfile",
          capmt->capmt_sockfile, capmt->capmt_port);
+  pthread_mutex_lock(&global_lock);
 }
 
 /**