2024-07-24 17:02:57 +02:00
|
|
|
/* Copyright (c) 2023-2024 Barcelona Supercomputing Center (BSC)
|
2023-04-14 11:10:44 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "instr.h"
|
|
|
|
#include "instr_nanos6.h"
|
|
|
|
|
|
|
|
/* Ensure a Nanos6 task cannot be executed again after ending. */
|
|
|
|
|
|
|
|
int
|
|
|
|
main(void)
|
|
|
|
{
|
|
|
|
instr_start(0, 1);
|
2023-11-10 12:34:57 +01:00
|
|
|
instr_nanos6_init();
|
2023-04-14 11:10:44 +02:00
|
|
|
|
|
|
|
uint32_t typeid = 666;
|
2024-07-24 17:02:57 +02:00
|
|
|
instr_nanos6_type_create((int32_t) typeid);
|
2023-04-14 11:10:44 +02:00
|
|
|
|
|
|
|
uint32_t taskid = 1;
|
2024-07-24 17:02:57 +02:00
|
|
|
instr_nanos6_task_create_and_execute((int32_t) taskid, typeid);
|
|
|
|
instr_nanos6_task_end((int32_t) taskid);
|
2023-04-14 11:10:44 +02:00
|
|
|
|
|
|
|
/* Run again the same task (should fail) */
|
2024-07-24 17:02:57 +02:00
|
|
|
instr_nanos6_task_execute((int32_t) taskid);
|
|
|
|
instr_nanos6_task_end((int32_t) taskid);
|
2023-04-14 11:10:44 +02:00
|
|
|
|
|
|
|
instr_end();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|