mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 22:35:06 -05:00
sched: stop dispatching timeouts on exit
Check in the dispatch loop whether the need_to_exit flag was set.
This commit is contained in:
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user