Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/rt-app.c b/src/rt-app.c index ffd3494..554d024 100644 --- a/src/rt-app.c +++ b/src/rt-app.c @@ -391,7 +391,11 @@ void *thread_body(void *arg) shutdown(SIGTERM); goto exit_miss; } - clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &t_next, NULL); + + clock_gettime(CLOCK_MONOTONIC, &t_now); + if (timespec_lower(&t_now, &t_next)) + clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &t_next, NULL); + i++; }