Message ID | 1453823216-23167-1-git-send-email-maxim.uvarov@linaro.org |
---|---|
State | Accepted |
Commit | fcd466aaff8fc0f6bd607f3a6eaa3b451d032beb |
Headers | show |
On 26.01.16 17:46, Maxim Uvarov wrote: > Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> > --- > test/validation/timer/timer.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c > index 5d89700..0bd67fb 100644 > --- a/test/validation/timer/timer.c > +++ b/test/validation/timer/timer.c > @@ -405,12 +405,14 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) > thr, nstale); > > /* Delay some more to ensure timeouts for expired timers can be > - * received */ > + * received. Can not use busy loop here to make background timer > + * thread finish their work. */ > struct timespec ts; > ts.tv_sec = 0; > - ts.tv_nsec = 1000000; /* 1ms */ > + ts.tv_nsec = (3 * RANGE_MS / 10 + 50) * ODP_TIME_MSEC_IN_NS; > if (nanosleep(&ts, NULL) < 0) > CU_FAIL_FATAL("nanosleep failed"); > + > while (nstale != 0) { > odp_event_t ev = odp_queue_deq(queue); > if (ev != ODP_EVENT_INVALID) { >
Merged, Maxim. On 01/26/2016 19:06, Ivan Khoronzhuk wrote: > > > On 26.01.16 17:46, Maxim Uvarov wrote: >> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> > > Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> > >> --- >> test/validation/timer/timer.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/test/validation/timer/timer.c >> b/test/validation/timer/timer.c >> index 5d89700..0bd67fb 100644 >> --- a/test/validation/timer/timer.c >> +++ b/test/validation/timer/timer.c >> @@ -405,12 +405,14 @@ static void *worker_entrypoint(void *arg >> TEST_UNUSED) >> thr, nstale); >> >> /* Delay some more to ensure timeouts for expired timers can be >> - * received */ >> + * received. Can not use busy loop here to make background timer >> + * thread finish their work. */ >> struct timespec ts; >> ts.tv_sec = 0; >> - ts.tv_nsec = 1000000; /* 1ms */ >> + ts.tv_nsec = (3 * RANGE_MS / 10 + 50) * ODP_TIME_MSEC_IN_NS; >> if (nanosleep(&ts, NULL) < 0) >> CU_FAIL_FATAL("nanosleep failed"); >> + >> while (nstale != 0) { >> odp_event_t ev = odp_queue_deq(queue); >> if (ev != ODP_EVENT_INVALID) { >> >
diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c index 5d89700..0bd67fb 100644 --- a/test/validation/timer/timer.c +++ b/test/validation/timer/timer.c @@ -405,12 +405,14 @@ static void *worker_entrypoint(void *arg TEST_UNUSED) thr, nstale); /* Delay some more to ensure timeouts for expired timers can be - * received */ + * received. Can not use busy loop here to make background timer + * thread finish their work. */ struct timespec ts; ts.tv_sec = 0; - ts.tv_nsec = 1000000; /* 1ms */ + ts.tv_nsec = (3 * RANGE_MS / 10 + 50) * ODP_TIME_MSEC_IN_NS; if (nanosleep(&ts, NULL) < 0) CU_FAIL_FATAL("nanosleep failed"); + while (nstale != 0) { odp_event_t ev = odp_queue_deq(queue); if (ev != ODP_EVENT_INVALID) {
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org> --- test/validation/timer/timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)