From: Mike Brady Date: Fri, 27 Jul 2018 09:58:36 +0000 (+0100) Subject: Remove use of SIGUSR1 and pthread_kill to stop threads. Not debugged! X-Git-Tag: 3.3RC0~286^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=577449dffaaf5cf8b71396dc55965d39dc6e93eb;p=thirdparty%2Fshairport-sync.git Remove use of SIGUSR1 and pthread_kill to stop threads. Not debugged! --- diff --git a/player.c b/player.c index bc479ed8..9bec9893 100644 --- a/player.c +++ b/player.c @@ -815,7 +815,8 @@ static abuf_t *buffer_get_frame(rtsp_conn_info *conn) { "from RTSP conversation %d.", conn->connection_number); conn->stop = 1; - pthread_kill(conn->thread, SIGUSR1); + pthread_cancel(conn->thread); + // pthread_kill(conn->thread, SIGUSR1); } } int rco = get_requested_connection_state_to_output(); diff --git a/rtsp.c b/rtsp.c index 16c6836a..f0e072c6 100644 --- a/rtsp.c +++ b/rtsp.c @@ -316,8 +316,11 @@ void ask_other_rtsp_conversation_threads_to_stop(pthread_t except_this_thread) { for (i = 0; i < nconns; i++) { if (((except_this_thread == 0) || (pthread_equal(conns[i]->thread, except_this_thread) == 0)) && (conns[i]->running != 0)) { - conns[i]->stop = 1; - pthread_kill(conns[i]->thread, SIGUSR1); + pthread_cancel(conns[i]->thread); + pthread_join(conns[i]->thread,NULL); + debug(1,"Connection %d: asked to stop.",conns[i]->connection_number); + // conns[i]->stop = 1; + // pthread_kill(conns[i]->thread, SIGUSR1); } } }