Commit 12cbc0a2 authored by Jack Moffitt's avatar Jack Moffitt
Browse files

Shut down the stats_connection and stats_callback threads cleanly when

stats_shutdown() is called.

svn path=/trunk/icecast/; revision=3044
parent cb398ff4
...@@ -413,6 +413,9 @@ static void *_stats_thread(void *arg) ...@@ -413,6 +413,9 @@ static void *_stats_thread(void *arg)
thread_sleep(300000); thread_sleep(300000);
} }
/* wake the other threads so they can shut down cleanly */
thread_cond_broadcast(&_event_signal_cond);
thread_exit(0); thread_exit(0);
return NULL; return NULL;
...@@ -593,6 +596,7 @@ void *stats_connection(void *arg) ...@@ -593,6 +596,7 @@ void *stats_connection(void *arg)
} else { } else {
thread_mutex_unlock(&local_event_mutex); thread_mutex_unlock(&local_event_mutex);
thread_cond_wait(&_event_signal_cond); thread_cond_wait(&_event_signal_cond);
if (!_stats_running) break;
continue; continue;
} }
...@@ -635,6 +639,7 @@ void *stats_callback(void *arg) ...@@ -635,6 +639,7 @@ void *stats_callback(void *arg)
} else { } else {
thread_mutex_unlock(&local_event_mutex); thread_mutex_unlock(&local_event_mutex);
thread_cond_wait(&_event_signal_cond); thread_cond_wait(&_event_signal_cond);
if (!_stats_running) break;
continue; continue;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment