Available Languages?:

OSA : OS_Task_GetCreated

OST_TASK_POINTER OS_Task_GetCreated ()

This service may be called after OS_Task_Create(). It returns a pointer to the TCB of the just-created task. This pointer can be used to control one task from another (delete, pause, etc).

Before calling this service be sure that OS_Task_Create() created a task (OS_IsError() should return false).

Call allowed:

Immediately after calling OS_Task_Create()

Parameters:

no

On return:

OST_TASK_POINTER Pointer to task's descriptor.

Example:

OST_TASK_POINTER tp1;
 
void Task1 (void)
{
    for (;;) OS_Yield();
}
 
void Task2 (void)
{
    for (;;)
    {
        OS_Task_Pause(tp1);
        /*...*/
        OS_Task_Continue(tp1);
    }
}
 
void main (void)
{
    OS_Init();
    OS_Task_Create (1, Task1);                     // Create Task1
    if (!OS_IsError()) tp1 = OS_Task_GetCreated(); // Get descriptor
 
    OS_Task_Create (5, Task2);                     // Create Task2
 
    OS_Run();
}

Old style name

See also:

See also

 
en/osa/ref/allservices/os_task_getcreated.txt · Last modified: 07.10.2010 13:57 (external edit)
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki