diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 19:15:05 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-25 19:15:05 +0000 |
commit | 80904539e63681b2dca74e3978effb17f0c071b0 (patch) | |
tree | eb49c2f705d2255cc6f05a7ee433aa87472c8a88 /nuttx/sched/task_init.c | |
parent | e95efd5d2a08dcb62c8c635089e4fe146965db45 (diff) | |
download | px4-firmware-80904539e63681b2dca74e3978effb17f0c071b0.tar.gz px4-firmware-80904539e63681b2dca74e3978effb17f0c071b0.tar.bz2 px4-firmware-80904539e63681b2dca74e3978effb17f0c071b0.zip |
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
Diffstat (limited to 'nuttx/sched/task_init.c')
-rw-r--r-- | nuttx/sched/task_init.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/nuttx/sched/task_init.c b/nuttx/sched/task_init.c index 5ba6b7e7d..6ae643948 100644 --- a/nuttx/sched/task_init.c +++ b/nuttx/sched/task_init.c @@ -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: |