From 810d06e0687a9091eba0a5e4e2fb71d19f34511b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 17 Jan 2008 14:40:06 +0000 Subject: [PATCH] minios: Add exit_thread prototype. Make sure exit_thread doesn't return by accident. Signed-off-by: Samuel Thibault --- include/sched.h | 1 + sched.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/sched.h b/include/sched.h index 9f209f1..734e441 100644 --- a/include/sched.h +++ b/include/sched.h @@ -39,6 +39,7 @@ struct thread* arch_create_thread(char *name, void (*function)(void *), void init_sched(void); void run_idle_thread(void); struct thread* create_thread(char *name, void (*function)(void *), void *data); +void exit_thread(void) __attribute__((noreturn)); void schedule(void); #define current get_current() diff --git a/sched.c b/sched.c index eedb1fe..0b613e6 100644 --- a/sched.c +++ b/sched.c @@ -198,7 +198,11 @@ void exit_thread(void) list_add(&thread->thread_list, &exited_threads); local_irq_restore(flags); /* Schedule will free the resources */ - schedule(); + while(1) + { + schedule(); + printk("schedule() returned! Trying again\n"); + } } void block(struct thread *thread) -- 2.39.5