diff options
author | H. Peter Anvin <hpa@zytor.com> | 2011-04-24 20:55:47 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2011-04-24 21:00:19 -0700 |
commit | f180d7c8ec74e0e15f1bcdf25c51899e2ca811c3 (patch) | |
tree | 9aefb37b132625fda83ae27099a6a8e599c115d0 /core/include | |
parent | 2948efb24928c01e5935124abb26ecedb55433e8 (diff) | |
download | syslinux-f180d7c8ec74e0e15f1bcdf25c51899e2ca811c3.tar.gz syslinux-f180d7c8ec74e0e15f1bcdf25c51899e2ca811c3.tar.xz syslinux-f180d7c8ec74e0e15f1bcdf25c51899e2ca811c3.zip |
pxe: use a separate poll thread instead of using an idle thread hook
The idle thread can never sleep, so it's not really safe to do
anything inside it. Instead, run a separate poll thread at low
priority; we can also do that to poll the serial console if needed.
Overall, the "classic" Syslinux idle handling really should go away
and be replaced by the idle thread.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/include')
-rw-r--r-- | core/include/thread.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/include/thread.h b/core/include/thread.h index 7c83b5a9..be3844af 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -3,9 +3,16 @@ #include <stddef.h> #include <inttypes.h> +#include <limits.h> #include <stdbool.h> #include <timer.h> +/* The idle thread runs at this priority */ +#define IDLE_THREAD_PRIORITY INT_MAX + +/* This priority should normally be used for hardware-polling threads */ +#define POLL_THREAD_PRIORITY (INT_MAX-1) + struct semaphore; struct thread_list { @@ -95,6 +102,4 @@ void kill_thread(struct thread *); void start_idle_thread(void); void test_thread(void); -extern void (*idle_hook)(void); - #endif /* _THREAD_H */ |