FS-6440 --resolve

This commit is contained in:
Anthony Minessale 2014-06-13 05:46:40 +05:00
parent ed7264b6d3
commit 0f62c4cd62
1 changed files with 10 additions and 3 deletions

View File

@ -1827,10 +1827,17 @@ static void *SWITCH_THREAD_FUNC switch_core_session_thread_pool_manager(switch_t
while(session_manager.ready) {
int check = 1;
int ttl = 0;
switch_mutex_lock(session_manager.cond2_mutex);
switch_thread_cond_timedwait(session_manager.cond, session_manager.cond_mutex, sleep);
switch_mutex_unlock(session_manager.cond2_mutex);
switch_mutex_lock(session_manager.mutex);
ttl = switch_queue_size(session_manager.thread_queue);
switch_mutex_unlock(session_manager.mutex);
if (!ttl) {
switch_mutex_lock(session_manager.cond2_mutex);
switch_thread_cond_timedwait(session_manager.cond, session_manager.cond_mutex, sleep);
switch_mutex_unlock(session_manager.cond2_mutex);
}
if (switch_micro_time_now() >= next) {
if (session_manager.popping) {