| |
Create a task.
-
Description:
-
This API is used to create a task. If the priority of the task created after system initialized is higher than the current task and task scheduling is not locked, it is scheduled for running. If not, the created task is added to the queue of ready tasks.
-
注意:
-
- During task creation, the task control block and task stack of the task that is previously automatically deleted are deallocated.
- The task name is a pointer and is not allocated memory.
- If the size of the task stack of the task to be created is 0, configure LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE to specify the default task stack size.
- The task stack size must be aligned on the boundary of 8 bytes. The size is determined by whether it is big enough to avoid task stack overflow.
- Less parameter value indicates higher task priority.
- The task name cannot be null.
- The pointer to the task executing function cannot be null.
- The two parameters of this interface is pointer, it should be a correct value, otherwise, the system may be abnormal.
-
参数:
-
|
参数名称 |
描述 |
|
puwTaskID |
[OUT] Type UINT32 * Task ID. |
|
pstInitParam |
[IN] Type TSK_INIT_PARAM_S * Parameter for task creation. |
-
返回值:
-
-
Dependency:
-
- los_task.h: the header file that contains the API declaration.
- los_config.h: the header file that contains system configuration items.
-
参见:
-
LOS_TaskDelete
-
自从:
-
Huawei LiteOS V100R001C00
|