[PDK-6848] OSAL: SYSBIOS: TaskP_delete to delete task only when deleteTerminatedTasks...
authorDon Dominic <a0486429@ti.com>
Mon, 15 Mar 2021 15:34:44 +0000 (21:04 +0530)
committerDon Dominic <a0486429@ti.com>
Mon, 15 Mar 2021 15:34:44 +0000 (21:04 +0530)
- In case of apps with the BIOS cfg 'Task.deleteTerminatedTasks' enabled,
  cleanup happens in BIOS idle task.
- Deleting terminated task will results in BIOS error.
- Hence to make BIOS config independent, TaskP_delete will check for the flag before deleting any task.

Signed-off-by: Don Dominic <a0486429@ti.com>
packages/ti/osal/src/tirtos/TaskP_tirtos.c

index 06406b4122c7aa8fa5598f82e6abfde86be83e74..345fb2204590849d0318db717e64d4cb06ec49a8 100755 (executable)
@@ -78,7 +78,15 @@ TaskP_Handle TaskP_create(void *taskfxn, const TaskP_Params *params)
  */
 TaskP_Status TaskP_delete(TaskP_Handle *handle)
 {
-    Task_delete((Task_Handle *)handle);
+    /* In case of apps with the BIOS cfg 'Task.deleteTerminatedTasks' enabled, 
+     * cleanup happens in BIOS idle task.
+     * Deleting terminated task will results in BIOS error.
+     * Hence to make BIOS config independent,
+     * Delete the Task only when flag is disbaled.*/
+    if (Task_deleteTerminatedTasks == FALSE)
+    {
+        Task_delete((Task_Handle *)handle);
+    }
     return TaskP_OK;
 }