]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Remove use of SIGUSR1 and pthread_kill to stop threads. Not debugged!
authorMike Brady <mikebrady@eircom.net>
Fri, 27 Jul 2018 09:58:36 +0000 (10:58 +0100)
committerMike Brady <mikebrady@eircom.net>
Fri, 27 Jul 2018 09:58:36 +0000 (10:58 +0100)
player.c
rtsp.c

index bc479ed8174c2c4e0dcd27e83400f32b55a3ab9f..9bec98937d9988e043a586399c44d8ed9ace775d 100644 (file)
--- 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 16c6836a4892196a3338c7db998f456d78d65123..f0e072c63da5f732175a299208674962ef05fc69 100644 (file)
--- 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);
     }
   }
 }