Add framework to support task groups

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5562 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-25 17:23:38 +00:00
parent b6472b58dc
commit e95efd5d2a
20 changed files with 681 additions and 145 deletions
+11 -1
View File
@@ -202,6 +202,9 @@ const tasklist_t g_tasklisttable[NUM_TASK_STATES] =
*/
static FAR _TCB g_idletcb;
#if defined(CONFIG_SCHED_HAVE_PARENT) && defined(CONFIG_SCHED_CHILD_STATUS)
static struct task_group_s g_idlegroup;
#endif
/* This is the name of the idle task */
@@ -280,13 +283,20 @@ void os_start(void)
g_idletcb.argv[0] = (char*)g_idlename;
#endif /* CONFIG_TASK_NAME_SIZE */
/* Join the IDLE group */
#ifdef HAVE_TASK_GROUP
g_idlegroup.tg_crefs = 1;
g_idlegroup.tg_flags = GROUP_FLAG_NOCLDWAIT;
g_idletcb.group = &g_idlegroup;
#endif
/* Then add the idle task's TCB to the head of the ready to run list */
dq_addfirst((FAR dq_entry_t*)&g_idletcb, (FAR dq_queue_t*)&g_readytorun);
/* Initialize the processor-specific portion of the TCB */
g_idletcb.flags = (TCB_FLAG_TTYPE_KERNEL | TCB_FLAG_NOCLDWAIT);
up_initial_state(&g_idletcb);
/* Initialize the semaphore facility(if in link). This has to be done