MCPcopy Create free account
hub / github.com/HelenOS/helenos / task_done

Function task_done

kernel/generic/src/proc/task.c:106–150  ·  view source on GitHub ↗

Kill all tasks except the current task. * */

Source from the content-addressed store, hash-verified

104 *
105 */
106void task_done(void)
107{
108 size_t tasks_left;
109 task_t *task;
110
111 if (ipc_box_0) {
112 task_t *task_0 = ipc_box_0->task;
113 ipc_box_0 = NULL;
114 /*
115 * The first task is held by kinit(), we need to release it or
116 * it will never finish cleanup.
117 */
118 task_release(task_0);
119 }
120
121 /* Repeat until there are any tasks except TASK */
122 do {
123#ifdef CONFIG_DEBUG
124 printf("Killing tasks... ");
125#endif
126 irq_spinlock_lock(&tasks_lock, true);
127 tasks_left = 0;
128
129 task = task_first();
130 while (task != NULL) {
131 if (task != TASK) {
132 tasks_left++;
133#ifdef CONFIG_DEBUG
134 printf("[%" PRIu64 "] ", task->taskid);
135#endif
136 task_kill_internal(task);
137 }
138
139 task = task_next(task);
140 }
141
142 irq_spinlock_unlock(&tasks_lock, true);
143
144 thread_sleep(1);
145
146#ifdef CONFIG_DEBUG
147 printf("\n");
148#endif
149 } while (tasks_left > 0);
150}
151
152errno_t tsk_constructor(void *obj, unsigned int kmflags)
153{

Callers 1

rebootFunction · 0.85

Calls 8

task_releaseFunction · 0.85
irq_spinlock_lockFunction · 0.85
task_firstFunction · 0.85
task_kill_internalFunction · 0.85
task_nextFunction · 0.85
irq_spinlock_unlockFunction · 0.85
thread_sleepFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected