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

Function nxtask_activate

sched/task/task_activate.c:60–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 ****************************************************************************/
59
60void nxtask_activate(FAR struct tcb_s *tcb)
61{
62 irqstate_t flags = enter_critical_section();
63 FAR struct tcb_s *rtcb = this_task();
64
65#ifdef CONFIG_SCHED_INSTRUMENTATION
66
67 /* Check if this is really a re-start */
68
69 if (tcb->task_state != TSTATE_TASK_INACTIVE)
70 {
71 /* Inform the instrumentation layer that the task
72 * has stopped
73 */
74
75 sched_note_stop(tcb);
76 }
77
78 /* Inform the instrumentation layer that the task
79 * has started
80 */
81
82 sched_note_start(tcb);
83#endif
84
85 /* Remove the task from waiting list */
86
87 nxsched_remove_blocked(tcb);
88
89 sinfo("%s pid=%d,TCB=%p\n", get_task_name(tcb),
90 tcb->pid, tcb);
91
92 /* Add the task to ready-to-run task list, and
93 * perform the context switch if one is needed
94 */
95
96 if (nxsched_add_readytorun(tcb))
97 {
98 up_switch_context(this_task(), rtcb);
99 }
100
101 leave_critical_section(flags);
102}

Callers 10

nxtask_start_forkFunction · 0.85
nxtask_spawn_createFunction · 0.85
nxthread_createFunction · 0.85
nxtask_restartFunction · 0.85
nx_pthread_createFunction · 0.85
exec_moduleFunction · 0.85

Calls 9

enter_critical_sectionFunction · 0.85
this_taskFunction · 0.85
sched_note_stopFunction · 0.85
sched_note_startFunction · 0.85
nxsched_remove_blockedFunction · 0.85
get_task_nameFunction · 0.85
nxsched_add_readytorunFunction · 0.85
leave_critical_sectionFunction · 0.85
up_switch_contextFunction · 0.50

Tested by

no test coverage detected