MCPcopy Create free account
hub / github.com/coreboot/coreboot / schedule

Function schedule

src/lib/thread.c:113–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113static void schedule(struct thread *t)
114{
115 struct thread *current = current_thread();
116
117 /* If t is NULL need to find new runnable thread. */
118 if (t == NULL) {
119 t = pop_runnable();
120 if (t == NULL)
121 die("Runnable thread list is empty!\n");
122 } else {
123 /* current is still runnable. */
124 push_runnable(current);
125 }
126
127 if (t->handle)
128 t->handle->state = THREAD_STARTED;
129
130 set_current_thread(t);
131
132 switch_to_thread(t->stack_current, &current->stack_current);
133}
134
135static void terminate_thread(struct thread *t, enum cb_err error)
136{

Callers 5

terminate_threadFunction · 0.85
thread_runFunction · 0.85
thread_run_untilFunction · 0.85

Calls 5

current_threadFunction · 0.85
pop_runnableFunction · 0.85
push_runnableFunction · 0.85
set_current_threadFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected