ovni/test/emu/nanos6/rerun-task-bad.c
Rodrigo Arias 354f2f50eb Register emulation models only if required
Until now, emulation models were always being registered via probe(),
which causes the emulator to initialize all the channels. To reduce the
overhead, the channels were not connected or registered in the bay
until the first event of that model was received. This delayed connect
was causing issues in muxes where the newly connected model required
refreshing the touched channels. Which in turn was causing unexpected
PRV events.

By determining which models we need to enable, we can remove the delayed
connect mechanism and just enable those models at initialization time,
and connect the channels.
2023-11-16 12:39:05 +01:00

31 lines
614 B
C

/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
* 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);
instr_nanos6_init();
uint32_t typeid = 666;
instr_nanos6_type_create(typeid);
uint32_t taskid = 1;
instr_nanos6_task_create_and_execute(taskid, typeid);
instr_nanos6_task_end(taskid);
/* Run again the same task (should fail) */
instr_nanos6_task_execute(taskid);
instr_nanos6_task_end(taskid);
instr_end();
return 0;
}