WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] [Mini-OS] Add exit_thread prototype. Make sure exit_

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] [Mini-OS] Add exit_thread prototype. Make sure exit_thread doesn't return by accident
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Thu, 17 Jan 2008 13:39:57 +0000
Delivery-date: Thu, 17 Jan 2008 05:41:08 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
Add exit_thread prototype. Make sure exit_thread doesn't return by accident.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

# HG changeset patch
# User Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
# Date 1200577127 0
# Node ID a7922b798098383d87bd62a4cc27595cfaad8dbe
# Parent  7f206dc573bcf5660c9cbbc6c3658f7d8c03a855
Add exit_thread prototype. Make sure exit_thread doesn't return by accident.

diff -r 7f206dc573bc -r a7922b798098 extras/mini-os/include/sched.h
--- a/extras/mini-os/include/sched.h    Thu Jan 17 13:33:08 2008 +0000
+++ b/extras/mini-os/include/sched.h    Thu Jan 17 13:38:47 2008 +0000
@@ -39,6 +39,7 @@ void init_sched(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 -r 7f206dc573bc -r a7922b798098 extras/mini-os/sched.c
--- a/extras/mini-os/sched.c    Thu Jan 17 13:33:08 2008 +0000
+++ b/extras/mini-os/sched.c    Thu Jan 17 13:38:47 2008 +0000
@@ -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)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [Mini-OS] Add exit_thread prototype. Make sure exit_thread doesn't return by accident, Samuel Thibault <=