OSA : OS_Task_Pause

OS_Task_Pause (OST_TASK_POINTER tp)

Pause task. The paused task will not get control until it is continued by the service OS_Task_Continue().

Before calling this service you should be sure that variable tp was initialized.

The macro this_task or the service OS_Task_GetCur() can be used to perform this operation on current task. When a task pauses itself, the kernel gets control immediately.

Call allowed:

Everywhere

Parameters:

tp Pointer to task descriptor (OST_TASK_POINTER)

Returns:

nothing

Example:

void Task (void)
{
    for (;;) {
        /*...*/
        OS_Task_Pause(tp);        // Pause external task
        /*...*/                   // Do time critical operations
        OS_Task_Continue(tp);     // Continue paused task
        /*...*/
    }
}

Old style name

OS_PauseTask

See also