osExitTask function
Declaration:
void osExitTask(
  ERROR ExitCode
);
Parameters:
ExitCode

A task exit code.

Description:

Function terminates current task.

When task is terminated, all of the owned critical sections are released and marked as abandoned. When the OS_ALLOW_OBJECT_DELETION is set to 1, all of the opened objects are closed.

If the value of OS_TASK_EXIT_CODE_FUNC is set for 1, osGetTaskExitCodefunction is available. It allows reading error code with a task has been finished.

The osExitTask function terminates current task, but it do not deletes the task object instance. To delete task object, the osCloseHandle must be performed. The task object will be deleted when it is terminated and all tasks that opened this object earlier close it. If it is closed before task termination, there is no way to delete this object.

Version:1.0
Header file:OS_Task.h (include OS_API.h)
See also: creating a task, ERROR, obtaining task exit code, OS_TASK_EXIT_CODE_FUNC, osCloseHandle, osGetTaskExitCode, tasks
SpaceShadow documentation