forked from len0rd/rockbox
Fix a hole in the scheduler where collisions between waking blocked threads in mutexes with interrupts waking blocked threads in message queues can occur. Queue posts will put the threads on a separate list that is then added to the running list with IRQs disabled on the next task switch or CPU wakeup. Basically no overhead for other operations. Seems a likely cause of my occasional observation of the backlight fade causing playback threads to stop running and a recently reported blocking violation upon USB plugging. Time will tell but banging the backlight on and off frequently hasn't hiccuped again for me on H120.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12915 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5e2984ad80
commit
165f62d0cd
3 changed files with 70 additions and 7 deletions
|
|
@ -119,6 +119,8 @@ struct core_entry {
|
|||
struct thread_entry threads[MAXTHREADS];
|
||||
struct thread_entry *running;
|
||||
struct thread_entry *sleeping;
|
||||
struct thread_entry *waking;
|
||||
struct thread_entry **wakeup_list;
|
||||
#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
|
||||
int switch_to_irq_level;
|
||||
#define STAY_IRQ_LEVEL -1
|
||||
|
|
@ -193,6 +195,7 @@ void set_irq_level_and_block_thread_w_tmo(struct thread_entry **list,
|
|||
#endif
|
||||
#endif
|
||||
void wakeup_thread(struct thread_entry **thread);
|
||||
void wakeup_thread_irq_safe(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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue