hi,
I am using BIOS bios_6_21_02_19
I have task which waits on a semaphore.
When I need to shutdown my system, I need to delete the task.
However when I use task delete its says "cannot delete blocked or running task"
As such I can ensure that task is not running and is instead blocked on the semaphore.
From a logical perspective it ok to delete the task now, but BIOS 6 API gives above error in CCS console
So I apply a workaround like below.
However I would prefer to not have such a workaround.
Let me know whats the typical logic followed when deleting a task in BIOS 6.
regards
Kedar
// work around to delete a task
Bool doExit;
Void my_Task_main() // for my_Task_Hndl
{
doExit = 0;
while(1)
{
Semaphore_pend(&someEvent, BIOS_WAIT_FOREVER);
if(doExit)
break; // exit task
// do some work based on event
}
my_Task_delete() // called for some other task context
{
doExit = 1;
Task_sleep(1); // wait for task to get exited
Task_delete(&my_task_Hndl);
}