mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 09:33:34 +08:00
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:
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user