Remove _DEFAULT_SOURCE from tests

This commit is contained in:
Rodrigo Arias 2023-03-22 19:06:18 +01:00 committed by Rodrigo Arias Mallo
parent 5b240ce372
commit 080d1df3e1
2 changed files with 6 additions and 7 deletions

View File

@ -1,12 +1,11 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#define _DEFAULT_SOURCE
#include <nosv.h>
#include <unistd.h>
#include "common.h"
#include "compat.h"
int
main(void)
@ -23,7 +22,7 @@ main(void)
if (nosv_attach(&task, type, 0, NULL, 0) != 0)
die("nosv_attach failed");
usleep(100);
sleep_us(100);
if (nosv_detach(0) != 0)
die("nosv_detach failed");

View File

@ -1,13 +1,13 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */
#define _DEFAULT_SOURCE
#include <nosv.h>
#include <stdatomic.h>
#include <unistd.h>
#include "common.h"
#include "compat.h"
#include "emu/emu_stat.h"
#define NTASKS 200
atomic_int ncompleted = 0;
@ -18,7 +18,7 @@ static void
task_body(nosv_task_t task)
{
UNUSED(task);
usleep(500);
sleep_us(500);
atomic_fetch_add(&ncompleted, 1);
}
@ -37,7 +37,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);