From 02a1aa4bc4b34f952603cfd9c9ed3385c9599186 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 4 Dec 2012 16:04:16 -0600 Subject: [PATCH] wait for threads to end on shutdown --- src/switch_core_session.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/switch_core_session.c b/src/switch_core_session.c index c2fb0ea8d6..74dae6e68a 100644 --- a/src/switch_core_session.c +++ b/src/switch_core_session.c @@ -1688,6 +1688,12 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread_pool_manager(switch_t check_queue(); } + + while(session_manager.running) { + switch_queue_trypush(session_manager.thread_queue, NULL); + switch_yield(20000); + } + return NULL; }