MCPcopy Create free account
hub / github.com/apache/nuttx / group_initialize

Function group_initialize

sched/group/group_create.c:228–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226 ****************************************************************************/
227
228void group_initialize(FAR struct tcb_s *tcb)
229{
230 FAR struct task_group_s *group;
231
232 DEBUGASSERT(tcb && tcb->group);
233 group = tcb->group;
234 spin_lock_init(&group->tg_lock);
235
236 /* Allocate mm_map list if required */
237
238 mm_map_initialize(&group->tg_mm_map,
239 (tcb->flags & TCB_FLAG_TTYPE_KERNEL) != 0);
240
241#ifdef HAVE_GROUP_MEMBERS
242 /* Assign the PID of this new task as a member of the group. */
243
244 sq_addlast(&tcb->member, &group->tg_members);
245#endif
246
247 /* Save the ID of the main task within the group of threads. This needed
248 * for things like SIGCHLD. It ID is also saved in the TCB of the main
249 * task but is also retained in the group which may persist after the main
250 * task has exited.
251 */
252
253 if (group != &g_kthread_group)
254 {
255 group->tg_pid = tcb->pid;
256 }
257
258 group->tg_info->ta_pid = group->tg_pid;
259}

Callers 3

idle_group_initializeFunction · 0.85
nxtask_setup_forkFunction · 0.85
nxtask_initFunction · 0.85

Calls 1

mm_map_initializeFunction · 0.85

Tested by

no test coverage detected