Skip to content
Snippets Groups Projects
Commit 11bc939d authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

* merge fixes

parent 1e238e41
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ void kernel_init(void)
sched_init();
if (thread_create(&main_tcb, main_stack, sizeof(main_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_stack, idle_name) < 0) {
if (thread_create(&main_tcb, main_stack, sizeof(main_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, idle_name) < 0) {
printf("kernel_init(): error creating idle task.\n");
}
......
......@@ -149,14 +149,12 @@ extern void cpu_switch_context_exit(void);
void sched_task_exit(void) {
DEBUG("sched_task_exit(): ending task %s...\n", active_thread->name);
tcb* thread = (tcb*)active_thread;
dINT();
sched_threads[active_thread->pid] = NULL;
num_tasks--;
sched_set_status((tcb*)active_thread, STATUS_STOPPED);
free(((tcb*)active_thread)->stack_start);
active_thread = NULL;
cpu_switch_context_exit();
}
......
......@@ -107,7 +107,7 @@ int thread_create(tcb *cb, char *stack, int stacksize, char priority, int flags,
while (pid < MAXTHREADS) {
if (sched_threads[pid] == NULL) {
sched_threads[pid] = cb;
pd->pid = pid;
cb->pid = pid;
break;
}
pid++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment