UINT32 LOS_TaskDelete ( UINT32  uwTaskID  ) 

Delete a task.

Description:
This API is used to delete a specified task and release the resources for its task stack and task control block.
注意:
  • The idle task and swtmr task cannot be deleted.
  • If delete current task maybe cause unexpected error.
  • If a task get a mutex is deleted or automatically deleted before release this mutex, other tasks pended this mutex maybe never be shchduled.
参数:
参数名称 描述
uwTaskID  [IN] Type UINT32 Task ID. The task id value is obtained from task creation.
返回值:
返回值 描述
LOS_ERRNO_TSK_OPERATE_IDLE  Check the task ID and do not operate on the idle task.
LOS_ERRNO_TSK_SUSPEND_SWTMR_NOT_ALLOWED  Check the task ID and do not operate on the swtmr task.
LOS_ERRNO_TSK_ID_INVALID  Invalid Task ID
LOS_ERRNO_TSK_NOT_CREATED  The task is not created.
LOS_OK  The task is successfully deleted.
Dependency:
  • los_task.h: the header file that contains the API declaration.
参见:
LOS_TaskCreate | LOS_TaskCreateOnly
自从:
Huawei LiteOS V100R001C00