debuggers.hg
changeset 16770:b18f70656fdb
minios: Add exit_thread prototype. Make sure exit_thread doesn't
return by accident.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
return by accident.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Thu Jan 17 14:40:06 2008 +0000 (2008-01-17) |
parents | 03c2236e0089 |
children | 10101bc8181f |
files | extras/mini-os/include/sched.h extras/mini-os/sched.c |
line diff
1.1 --- a/extras/mini-os/include/sched.h Thu Jan 17 14:39:45 2008 +0000 1.2 +++ b/extras/mini-os/include/sched.h Thu Jan 17 14:40:06 2008 +0000 1.3 @@ -39,6 +39,7 @@ struct thread* arch_create_thread(char * 1.4 void init_sched(void); 1.5 void run_idle_thread(void); 1.6 struct thread* create_thread(char *name, void (*function)(void *), void *data); 1.7 +void exit_thread(void) __attribute__((noreturn)); 1.8 void schedule(void); 1.9 1.10 #define current get_current()
2.1 --- a/extras/mini-os/sched.c Thu Jan 17 14:39:45 2008 +0000 2.2 +++ b/extras/mini-os/sched.c Thu Jan 17 14:40:06 2008 +0000 2.3 @@ -198,7 +198,11 @@ void exit_thread(void) 2.4 list_add(&thread->thread_list, &exited_threads); 2.5 local_irq_restore(flags); 2.6 /* Schedule will free the resources */ 2.7 - schedule(); 2.8 + while(1) 2.9 + { 2.10 + schedule(); 2.11 + printk("schedule() returned! Trying again\n"); 2.12 + } 2.13 } 2.14 2.15 void block(struct thread *thread)