]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] Wait for all EVENT_DISPATCH_QUEUE_THREADS before killing the logging which... 174/head
authorAndrey Volk <andywolk@gmail.com>
Tue, 10 Dec 2019 15:08:27 +0000 (19:08 +0400)
committerAndrey Volk <andywolk@gmail.com>
Tue, 17 Dec 2019 17:03:20 +0000 (21:03 +0400)
src/switch_event.c

index 6b1a3bfc422c9a726b0be646aaff1d40640f8789..b1e02e570aa335e7aaa1c84e7b9ce49676fc907c 100644 (file)
@@ -571,9 +571,11 @@ SWITCH_DECLARE(switch_status_t) switch_event_shutdown(void)
 
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Stopping dispatch threads\n");
 
-               for(x = 0; x < (uint32_t)DISPATCH_THREAD_COUNT; x++) {
-                       switch_status_t st;
-                       switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]);
+               for(x = 0; x < (uint32_t)MAX_DISPATCH; x++) {
+                       if (EVENT_DISPATCH_QUEUE_THREADS[x]) {
+                               switch_status_t st;
+                               switch_thread_join(&st, EVENT_DISPATCH_QUEUE_THREADS[x]);
+                       }
                }
        }