Commit 01124cb3 authored by Swann Perarnau's avatar Swann Perarnau
Browse files

[fix] valgrind scheduler doesn't like nanosleep

nanosleep is not guaranteed to sleep under valgrind, which make our
async test code run forever. Change for a random amount of work in a
loop, that's somehow better.
parent 59bc7f76
......@@ -24,11 +24,11 @@
struct aml_task_out *aml_task_mockup_work(struct aml_task_in *in)
{
(void)in;
struct timespec us;
long int us = 1000 * (rand() % 10);
long int count = 0;
for (long int i = 0; i < us; i++)
count += i ^ (count + i * 42);
us.tv_sec = 0;
us.tv_nsec = 1000 * (rand() % 10);
nanosleep(&us, NULL);
return NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment