mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-06-23 06:25:24 +00:00
Fix: Fixed a race condition in event_shutdown()
This commit is contained in:
parent
f20dfcef63
commit
07899c4aab
|
@ -209,6 +209,8 @@ void event_initialise(void) {
|
|||
}
|
||||
|
||||
void event_shutdown(void) {
|
||||
event_t *event_queue_to_free = NULL;
|
||||
|
||||
/* stop thread */
|
||||
if (!event_running)
|
||||
return;
|
||||
|
@ -223,10 +225,12 @@ void event_shutdown(void) {
|
|||
/* shutdown everything */
|
||||
thread_mutex_lock(&event_lock);
|
||||
event_thread = NULL;
|
||||
event_release(event_queue);
|
||||
event_queue_to_free = event_queue;
|
||||
event_queue = NULL;
|
||||
thread_mutex_unlock(&event_lock);
|
||||
|
||||
event_release(event_queue_to_free);
|
||||
|
||||
/* destry mutex */
|
||||
thread_mutex_destroy(&event_lock);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user