If the next wake up date of the timer is already in the past when we execute the event, we resets the timer.t_next to the current time. Otherwise, if the delay has been too large, we might never recover it and the timer will always be in the past.
Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/rt-app.c b/src/rt-app.c index 37e9892..20383a2 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -253,6 +253,8 @@ static int run_event(event_data_t *event, int dry_run, clock_gettime(CLOCK_MONOTONIC, &t_now); if (timespec_lower(&t_now, &rdata->res.timer.t_next)) clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &rdata->res.timer.t_next, NULL); + else + clock_gettime(CLOCK_MONOTONIC, &rdata->res.timer.t_next); } break; case rtapp_suspend: