[syslinux:lwip] exit_thread: easier form of the same test...

syslinux-bot for H. Peter Anvin hpa at zytor.com
Sat Apr 30 12:15:24 PDT 2011


Commit-ID:  c69a11a0e4e232965845b8fa3e059f10e6715ef8
Gitweb:     http://syslinux.zytor.com/commit/c69a11a0e4e232965845b8fa3e059f10e6715ef8
Author:     H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sat, 30 Apr 2011 12:11:48 -0700
Committer:  H. Peter Anvin <hpa at zytor.com>
CommitDate: Sat, 30 Apr 2011 12:11:48 -0700

exit_thread: easier form of the same test...

Instead of testing __schedule_lock explicitly, we can just call
kaboom() if the scheduler returns, since that can only happen if the
scheduler lock is set, and is in fact the reason we can't be here with
the scheduler locked in the first place.

Signed-off-by: H. Peter Anvin <hpa at zytor.com>


---
 core/thread/exit_thread.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/core/thread/exit_thread.c b/core/thread/exit_thread.c
index 47b8aed..92c84a4 100644
--- a/core/thread/exit_thread.c
+++ b/core/thread/exit_thread.c
@@ -3,8 +3,6 @@
 #include <stdlib.h>
 #include <klibc/compiler.h>
 
-extern int __schedule_lock;
-
 __noreturn __exit_thread(void)
 {
     irq_state_t irq;
@@ -12,9 +10,6 @@ __noreturn __exit_thread(void)
 
     irq = irq_save();
 
-    if (__schedule_lock)
-	kaboom();		/* Uh-oh... */
-
     /* Remove from the linked list */
     curr->list.prev->next = curr->list.next;
     curr->list.next->prev = curr->list.prev;
@@ -31,7 +26,5 @@ __noreturn __exit_thread(void)
     __schedule();
 
     /* We should never get here */
-    irq_restore(irq);
-    while (1)
-	asm volatile("hlt");
+    kaboom();
 }



More information about the Syslinux-commits mailing list