Add a start hook that can be setup to call a function in the context of a new thread before the new threads main() has been called.

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5571 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2013-01-27 15:52:58 +00:00
parent 47b94bafa5
commit e96d8f046b
17 changed files with 239 additions and 57 deletions
+9
View File
@@ -94,6 +94,15 @@ void task_start(void)
FAR _TCB *tcb = (FAR _TCB*)g_readytorun.head;
int argc;
/* Execute the start hook if one has been registered */
#ifdef CONFIG_SCHED_STARTHOOK
if (tcb->starthook)
{
tcb->starthook(tcb->starthookarg);
}
#endif
/* Count how many non-null arguments we are passing */
for (argc = 1; argc <= CONFIG_MAX_TASK_ARGS; argc++)