[syslinux:lwip] exit_thread: make sure we don't run under scheduler lock
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Sat Apr 30 12:13:14 PDT 2011
Commit-ID: 4db50faba162ad1c5803173ac562326934d016e1
Gitweb: http://syslinux.zytor.com/commit/4db50faba162ad1c5803173ac562326934d016e1
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Sat, 30 Apr 2011 12:09:41 -0700
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Sat, 30 Apr 2011 12:09:41 -0700
exit_thread: make sure we don't run under scheduler lock
If we ever end up in __exit_thread with the scheduler locked, we're
completely fscked.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
core/thread/exit_thread.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/core/thread/exit_thread.c b/core/thread/exit_thread.c
index f598624..47b8aed 100644
--- a/core/thread/exit_thread.c
+++ b/core/thread/exit_thread.c
@@ -3,6 +3,8 @@
#include <stdlib.h>
#include <klibc/compiler.h>
+extern int __schedule_lock;
+
__noreturn __exit_thread(void)
{
irq_state_t irq;
@@ -10,6 +12,9 @@ __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;
More information about the Syslinux-commits
mailing list