Check in the dispatch loop whether the need_to_exit flag was set.
n_entries_on_start = n_timer_queue_entries;
n_done = 0;
- while (1) {
+ do {
LCL_ReadRawTime(now);
if (!(n_timer_queue_entries > 0 &&
n_done > 4 * MAX(n_timer_queue_entries, n_entries_on_start) &&
fabs(UTI_DiffTimespecsToDouble(now, &last_select_ts_raw)) / n_done < 0.01)
LOG_FATAL("Possible infinite loop in scheduling");
- }
+
+ } while (!need_to_exit);
}
/* ================================================== */