====== OSA : OS_Task_GetCur ======
**OST_TASK_POINTER OS_Task_GetCur ()**\\
=== ===
{{osa:ref:attr_call_task.png|Allowed only in task}}
Get pointer to task control block (##[[en:osa:ref:description:data_types#OST_TASK_POINTER|OST_TASK_POINTER]]##) of current task. This pointer can be used in services that control the task indirectly (##[[en:osa:ref:allservices:OS_Task_Pause|OS_Task_Pause]]##, ##[[en:osa:ref:allservices:OS_Task_Continue|OS_Task_Continue]]##, etc). Usually this service is called at the beginning of the task-function.
=== Call allowed: ===
Only in task
=== Parameters: ===
None
=== Returns: ===
{| class = "fpl"
|-
|//''[[en:osa:ref:description:data_types#OST_TASK_POINTER|OST_TASK_POINTER]]''//
| Pointer to current task's descriptor
|}
=== Example: ===
OST_TASK_POINTER tp_Task;
void Task (void)
{
tp_Task = OS_Task_GetCur();
for (;;) {
/*...*/
}
}
=== 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|All services]]
~~UP~~