Thanks a lot, Karel.
After going through the code, I wanna try to summurize this:
1. RTCS_task_create created the task RTCS_task, and take a local variable "&task" as parameter, then wait the task.sem be posted.
{
......
struct rtcs_task_state task;
RTCS_sem_init(&task.sem);
task.start = start;
task.arg = arg;
task.error = RTCS_OK;
...
task_template.TASK_ADDRESS = RTCS_task;
task_template.CREATION_PARAMETER = (uint_32)&task;
if (_task_create(0, 0, (uint_32)&task_template) == MQX_NULL_TASK_ID) {
...
} /* Endif */
RTCS_sem_wait(&task.sem);
RTCS_sem_destroy(&task.sem);
return task.error;
} /* Endbody */
2. RTCS_task run and call task->start(task->arg, task), ie, TCPIP_task(task->arg, task). The "task" here point to "struct rtcs_task_state task" within RTCS_task_create's stack.
3. TCPIP_task runs and post task.sem and continue running
4. RTCS_task_create return.
So the "creator" just a local variable of the creator.