Remove _DEFAULT_SOURCE from tests
This commit is contained in:
parent
5b240ce372
commit
080d1df3e1
@ -1,12 +1,11 @@
|
|||||||
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later */
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
|
|
||||||
#include <nosv.h>
|
#include <nosv.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "compat.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(void)
|
main(void)
|
||||||
@ -23,7 +22,7 @@ main(void)
|
|||||||
if (nosv_attach(&task, type, 0, NULL, 0) != 0)
|
if (nosv_attach(&task, type, 0, NULL, 0) != 0)
|
||||||
die("nosv_attach failed");
|
die("nosv_attach failed");
|
||||||
|
|
||||||
usleep(100);
|
sleep_us(100);
|
||||||
|
|
||||||
if (nosv_detach(0) != 0)
|
if (nosv_detach(0) != 0)
|
||||||
die("nosv_detach failed");
|
die("nosv_detach failed");
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later */
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
|
|
||||||
#include <nosv.h>
|
#include <nosv.h>
|
||||||
#include <stdatomic.h>
|
#include <stdatomic.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "compat.h"
|
||||||
|
#include "emu/emu_stat.h"
|
||||||
|
|
||||||
#define NTASKS 200
|
#define NTASKS 200
|
||||||
atomic_int ncompleted = 0;
|
atomic_int ncompleted = 0;
|
||||||
@ -18,7 +18,7 @@ static void
|
|||||||
task_body(nosv_task_t task)
|
task_body(nosv_task_t task)
|
||||||
{
|
{
|
||||||
UNUSED(task);
|
UNUSED(task);
|
||||||
usleep(500);
|
sleep_us(500);
|
||||||
atomic_fetch_add(&ncompleted, 1);
|
atomic_fetch_add(&ncompleted, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ main(void)
|
|||||||
nosv_submit(tasks[i], 0);
|
nosv_submit(tasks[i], 0);
|
||||||
|
|
||||||
while (atomic_load(&ncompleted) != NTASKS)
|
while (atomic_load(&ncompleted) != NTASKS)
|
||||||
usleep(1000);
|
sleep_us(1000);
|
||||||
|
|
||||||
for (int i = 0; i < NTASKS; i++)
|
for (int i = 0; i < NTASKS; i++)
|
||||||
nosv_destroy(tasks[i], 0);
|
nosv_destroy(tasks[i], 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user