mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 06:41:36 +08:00
Add logic to keep track of members of a task group
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5563 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+12
-1
@@ -126,7 +126,7 @@ int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||
/* Create a new task group */
|
||||
|
||||
#ifdef HAVE_TASK_GROUP
|
||||
ret = group_create(tcb);
|
||||
ret = group_allocate(tcb);
|
||||
if (ret < 0)
|
||||
{
|
||||
errcode = -ret;
|
||||
@@ -168,6 +168,17 @@ int task_init(FAR _TCB *tcb, const char *name, int priority,
|
||||
/* Setup to pass parameters to the new task */
|
||||
|
||||
(void)task_argsetup(tcb, name, argv);
|
||||
|
||||
/* Now we have enough in place that we can join the group */
|
||||
|
||||
#ifdef HAVE_TASK_GROUP
|
||||
ret = group_initialize(tcb);
|
||||
if (ret < 0)
|
||||
{
|
||||
errcode = -ret;
|
||||
goto errout_with_env;
|
||||
}
|
||||
#endif
|
||||
return OK;
|
||||
|
||||
errout_with_env:
|
||||
|
||||
Reference in New Issue
Block a user