From dee43ece2086e15894934b754e47cb7ce5882cda Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 9 Mar 2007 08:03:18 +0000 Subject: Put an end to priority inversion in the ata driver. Gave up trying to have fully atomic dual use mutexes so just replaced the ata driver locking with spins. Maybe I'll have better luck later. Things should run smoothly with database updates and such happening in the background. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12688 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/thread.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'firmware/export/thread.h') diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 3a979722b9..7a9414c79f 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h @@ -105,6 +105,7 @@ struct thread_entry { unsigned short stack_size; #ifdef HAVE_PRIORITY_SCHEDULING unsigned short priority; + unsigned long priority_x; long last_run; #endif struct thread_entry *next, *prev; @@ -114,6 +115,10 @@ struct core_entry { struct thread_entry threads[MAXTHREADS]; struct thread_entry *running; struct thread_entry *sleeping; +#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME + int switch_to_irq_level; + #define STAY_IRQ_LEVEL -1 +#endif }; #ifdef HAVE_PRIORITY_SCHEDULING @@ -149,7 +154,14 @@ void wakeup_thread(struct thread_entry **thread); #ifdef HAVE_PRIORITY_SCHEDULING int thread_set_priority(struct thread_entry *thread, int priority); int thread_get_priority(struct thread_entry *thread); -#endif +/* Yield that guarantees thread execution once per round regardless of + thread's scheduler priority - basically a transient realtime boost + without altering the scheduler's thread precedence. */ +void priority_yield(void); +#else +static inline void priority_yield(void) + { yield(); } +#endif /* HAVE_PRIORITY_SCHEDULING */ struct thread_entry * thread_get_current(void); void init_threads(void); int thread_stack_usage(const struct thread_entry *thread); -- cgit v1.2.3