Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Files

os.h/os_task.c

Prototype

Code Block
void  OSTaskDel (OS_TCB  *p_tcb,
                 OS_ERR  *p_err)

Arguments

p_tcb

is a pointer to the TCB of the task to delete or, you can pass a NULL pointer to specify that the calling task delete itself. If deleting the calling task, the scheduler will be invoked so that the next highest-priority task is executed.

...

OS_CFG_TASK_DEL_EN must be enabled in os_cfg.h. Refer to µC-OS-III Configuration Manual.

Callers

Application.

Notes/Warnings

  1. OSTaskDel() verifies that the user is not attempting to delete the µC/OS-III idle task and the ISR handler task.
  2. Be careful when deleting a task that owns resources.

Example Usage

Code Block
titleOSTaskDel() example usage
          OS_TCB  MyTaskTCB;
           
           
          void TaskX (void *p_arg)
          {
              OS_ERR  err;
           
           
              while (DEF_ON) {
                  :
                  :
                  OSTaskDel(&MyTaskTCB,
                            &err);
                  /* Check "err" */
                  :
                  :
              }
          }