mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 00:00:44 +00:00
stop sched thread quicker on global destroy
This commit is contained in:
parent
972504a3ca
commit
afdf50d423
@ -119,10 +119,15 @@ static void *run_main_schedule(ftdm_thread_t *thread, void *data)
|
|||||||
/* there are no free runs, wait a bit and check again (FIXME: use ftdm_interrupt_t for this) */
|
/* there are no free runs, wait a bit and check again (FIXME: use ftdm_interrupt_t for this) */
|
||||||
ftdm_mutex_unlock(sched_globals.mutex);
|
ftdm_mutex_unlock(sched_globals.mutex);
|
||||||
|
|
||||||
ftdm_sleep(sleepms);
|
if (ftdm_running()) {
|
||||||
|
ftdm_sleep(sleepms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (current = sched_globals.freeruns; current; current = current->next) {
|
for (current = sched_globals.freeruns; current; current = current->next) {
|
||||||
|
if (!ftdm_running()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* first run the schedule */
|
/* first run the schedule */
|
||||||
ftdm_sched_run(current);
|
ftdm_sched_run(current);
|
||||||
@ -142,7 +147,9 @@ static void *run_main_schedule(ftdm_thread_t *thread, void *data)
|
|||||||
|
|
||||||
ftdm_mutex_unlock(sched_globals.mutex);
|
ftdm_mutex_unlock(sched_globals.mutex);
|
||||||
|
|
||||||
ftdm_sleep(sleepms);
|
if (ftdm_running()) {
|
||||||
|
ftdm_sleep(sleepms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ftdm_log(FTDM_LOG_NOTICE, "Main scheduling thread going out ...\n");
|
ftdm_log(FTDM_LOG_NOTICE, "Main scheduling thread going out ...\n");
|
||||||
sched_globals.running = 0;
|
sched_globals.running = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user