MODAPP-459

This commit is contained in:
Anthony Minessale 2010-09-22 18:14:24 -05:00
parent cc42515e9f
commit b02c69bba9
2 changed files with 8 additions and 5 deletions

View File

@ -203,10 +203,10 @@ static void *SWITCH_THREAD_FUNC timer_thread_run(switch_thread_t *thread, void *
goto end;
}
while(t38_state_list.thread_running) {
switch_mutex_lock(globals.cond_mutex);
while(t38_state_list.thread_running) {
switch_mutex_lock(t38_state_list.mutex);
if (!t38_state_list.head) {
@ -227,6 +227,8 @@ static void *SWITCH_THREAD_FUNC timer_thread_run(switch_thread_t *thread, void *
switch_core_timer_next(&timer);
}
switch_mutex_unlock(globals.cond_mutex);
end:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "FAX timer thread ended.\n");

View File

@ -911,10 +911,9 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
sql_manager.thread_running = 1;
while (sql_manager.thread_running == 1) {
switch_mutex_lock(sql_manager.cond_mutex);
while (sql_manager.thread_running == 1) {
if (sql || switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS ||
switch_queue_trypop(sql_manager.sql_queue[1], &pop) == SWITCH_STATUS_SUCCESS) {
@ -993,6 +992,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
}
}
switch_mutex_unlock(sql_manager.cond_mutex);
while (switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS) {
free(pop);
}