]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
minios: Add exit_thread prototype. Make sure exit_thread doesn't
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Jan 2008 14:40:06 +0000 (14:40 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 17 Jan 2008 14:40:06 +0000 (14:40 +0000)
return by accident.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
include/sched.h
sched.c

index 9f209f195da051a4fc5150aba4d6aa31a01dec7b..734e441a154f6332e2ad34be7c71627f411a7c03 100644 (file)
@@ -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 eedb1fe7ed3aa3744b270089a35478b495c927b9..0b613e64d4bc1e6abf0b239b4348d10dae96346f 100644 (file)
--- 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)