From: Anthony Minessale Date: Tue, 4 Dec 2012 22:04:16 +0000 (-0600) Subject: wait for threads to end on shutdown X-Git-Tag: v1.3.8~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02a1aa4bc4b34f952603cfd9c9ed3385c9599186;p=thirdparty%2Ffreeswitch.git wait for threads to end on shutdown --- 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; }