capmt: fix the mutex deadlock in capmt_destroy()

This commit is contained in:
Jaroslav Kysela 2014-06-09 19:12:01 +02:00
parent 81dd4d1dd0
commit 11bd63d590

View 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);
}
/**