os_task_remove

int os_task_remove(struct os_task *t)

Removes a task, t, from the task list. A task cannot be removed when it is in one of the following states:

  • It is running - a task cannot remove itself.
  • It has not been initialized.
  • It is holding a lock on a semphore or mutex.
  • It is suspended waiting on a lock (semaphore or mutex) or for an event on an event queue.
ArgumentsDescription
tPointer to the os_task structure for the task to be removed

struct os_task worker_task; int remove_my_worker_task(void) { /* Add error checking code to ensure task can removed. */ /* Call os_task_remove to remove the worker task */ rc = os_task_remove(&worker_task); return rc; }