Change usleep() to sleep_us() in RT tests

This commit is contained in:
Raúl Peñacoba Veigas 2024-01-10 16:01:22 +00:00 committed by Rodrigo Arias
parent 4993197fb9
commit 3e7006cec7
3 changed files with 6 additions and 3 deletions

View File

@ -3,13 +3,14 @@
#define _GNU_SOURCE
#include <unistd.h>
#include "compat.h"
int
main(void)
{
#pragma oss task if (0)
{
usleep(1000);
sleep_us(1000);
}
return 0;
}

View File

@ -3,13 +3,14 @@
#define _GNU_SOURCE
#include <unistd.h>
#include "compat.h"
int
main(void)
{
#pragma oss task for
for (int i = 0; i < 1024; i++)
usleep(1000);
sleep_us(1000);
return 0;
}

View File

@ -9,6 +9,7 @@
#include <unistd.h>
#include "common.h"
#include "compat.h"
#define NTASKS 200
atomic_int ncompleted = 0;
@ -46,7 +47,7 @@ main(void)
nosv_submit(tasks[i], 0);
while (atomic_load(&ncompleted) != NTASKS)
usleep(1000);
sleep_us(1000);
for (int i = 0; i < NTASKS; i++)
nosv_destroy(tasks[i], 0);