====== OSA : OS_Task_GetCreated ======
**OST_TASK_POINTER OS_Task_GetCreated ()**\\
=== ===
This service may be called after ##[[en:osa:ref:allservices:OS_Task_Create|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 ##[[en:osa:ref:allservices:OS_Task_Create|OS_Task_Create]]##() created a task (##[[en:osa:ref:allservices:OS_IsError|OS_IsError]]##() should return false).
=== Call allowed: ===
Immediately after calling ##[[en:osa:ref:allservices:OS_Task_Create|OS_Task_Create]]##()
=== Parameters: ===
no
=== On return: ===
{| class = "fpl"
|-
|//''[[en:osa:ref:description:data_types#OST_TASK_POINTER|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: ===
* [[en:osa:ref:allservices:OS_Task_Create|OS_Task_Create]]
* [[en:osa:ref:allservices:OS_Task_Replace|OS_Task_Replace]]
* [[en:osa:ref:allservices:OS_Task_Delete|OS_Task_Delete]]
* [[en:osa:ref:allservices:OS_Task_Define|OS_Task_Define]]
* [[en:osa:ref:allservices:OS_Task_GetCur|OS_Task_GetCur]]
* [[en:osa:ref:allservices:OS_Task_GetCreated|OS_Task_GetCreated]]
* [[en:osa:ref:allservices:OS_Task_Pause|OS_Task_Pause]]
* [[en:osa:ref:allservices:OS_Task_Continue|OS_Task_Continue]]
* [[en:osa:ref:allservices:OS_Task_IsPaused|OS_Task_IsPaused]]
* [[en:osa:ref:allservices:OS_Task_GetPriority|OS_Task_GetPriority]]
* [[en:osa:ref:allservices:OS_Task_SetPriority|OS_Task_SetPriority]]
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|Brief list]]
~~UP~~
=== See also ===
----
* [[en:osa:ref:services:alphabetical|Alphabetical]]
* [[en:osa:ref:services:brieflist|All services]]
~~UP~~