From 12cbc0a29d55be45d951806c6061875d4e0dc330 Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Thu, 14 Feb 2002 00:28:41 +0000 Subject: [PATCH] Shut down the stats_connection and stats_callback threads cleanly when stats_shutdown() is called. svn path=/trunk/icecast/; revision=3044 --- src/stats.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stats.c b/src/stats.c index d85d41dc..d5638438 100644 --- a/src/stats.c +++ b/src/stats.c @@ -413,6 +413,9 @@ static void *_stats_thread(void *arg) thread_sleep(300000); } + /* wake the other threads so they can shut down cleanly */ + thread_cond_broadcast(&_event_signal_cond); + thread_exit(0); return NULL; @@ -593,6 +596,7 @@ void *stats_connection(void *arg) } else { thread_mutex_unlock(&local_event_mutex); thread_cond_wait(&_event_signal_cond); + if (!_stats_running) break; continue; } @@ -635,6 +639,7 @@ void *stats_callback(void *arg) } else { thread_mutex_unlock(&local_event_mutex); thread_cond_wait(&_event_signal_cond); + if (!_stats_running) break; continue; }