sched: stop dispatching timeouts on exit
Check in the dispatch loop whether the need_to_exit flag was set.
This commit is contained in:
parent
59e8b79034
commit
e7897eb9cc
1 changed files with 3 additions and 2 deletions
5
sched.c
5
sched.c
|
@ -506,7 +506,7 @@ dispatch_timeouts(struct timespec *now) {
|
||||||
n_entries_on_start = n_timer_queue_entries;
|
n_entries_on_start = n_timer_queue_entries;
|
||||||
n_done = 0;
|
n_done = 0;
|
||||||
|
|
||||||
while (1) {
|
do {
|
||||||
LCL_ReadRawTime(now);
|
LCL_ReadRawTime(now);
|
||||||
|
|
||||||
if (!(n_timer_queue_entries > 0 &&
|
if (!(n_timer_queue_entries > 0 &&
|
||||||
|
@ -542,7 +542,8 @@ dispatch_timeouts(struct timespec *now) {
|
||||||
n_done > 4 * MAX(n_timer_queue_entries, n_entries_on_start) &&
|
n_done > 4 * MAX(n_timer_queue_entries, n_entries_on_start) &&
|
||||||
fabs(UTI_DiffTimespecsToDouble(now, &last_select_ts_raw)) / n_done < 0.01)
|
fabs(UTI_DiffTimespecsToDouble(now, &last_select_ts_raw)) / n_done < 0.01)
|
||||||
LOG_FATAL("Possible infinite loop in scheduling");
|
LOG_FATAL("Possible infinite loop in scheduling");
|
||||||
}
|
|
||||||
|
} while (!need_to_exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
Loading…
Reference in a new issue