Commit e88a3cdf authored by Robert Schmidt's avatar Robert Schmidt

bugfix ITTI: clean up in itti_exit_task()

- when exiting task, the task is set as "not configured"
- this permits to start a task again
parent ea65ddad
......@@ -775,15 +775,19 @@ void itti_mark_task_ready(task_id_t task_id)
void itti_exit_task(void)
{
#if defined(OAI_EMU) || defined(RTAI)
task_id_t task_id = itti_get_current_task_id();
thread_id_t thread_id = TASK_GET_THREAD_ID(task_id);
#if defined(OAI_EMU) || defined(RTAI)
if (task_id > TASK_UNKNOWN) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
__sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id)));
}
#endif
itti_desc.threads[thread_id].task_state = TASK_STATE_NOT_CONFIGURED;
itti_desc.created_tasks--;
ITTI_DEBUG(ITTI_DEBUG_EXIT, "Thread for task %s (%d) exits\n", itti_get_task_name(task_id), task_id);
pthread_exit (NULL);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment