diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2015-08-05 11:07:48 +0200 |
---|---|---|
committer | Vincent Guittot <vincent.guittot@linaro.org> | 2015-08-11 17:42:50 +0200 |
commit | 4a827b453096a81764843f06c3d9d6cfc58e9987 (patch) | |
tree | cc29f11ba9a6d095fdc2fbc3a146aa9222dc7dfb /src | |
parent | c0dec8fd7edce16acaa065a7984ac79e07ed6e7a (diff) |
rt-app: reset timer that overruns
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/rt-app.c | 2 |
1 files changed, 2 insertions, 0 deletions
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: |