forked from len0rd/rockbox
Fix a minor ;) problem that would keep other threads from running during priority_yield calls unless they had aged too much. Basically it operates in the manner of the original implementation. _May_ help 5.5g buffering problems so do test that.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16197 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d08af61394
commit
537b78b216
1 changed files with 2 additions and 2 deletions
|
|
@ -1615,12 +1615,13 @@ void switch_thread(struct thread_entry *old)
|
||||||
* got CPU time. */
|
* got CPU time. */
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
int priority = MIN(thread->priority, thread->priority_x);
|
int priority = thread->priority;
|
||||||
|
|
||||||
if (priority < cores[core].highest_priority)
|
if (priority < cores[core].highest_priority)
|
||||||
cores[core].highest_priority = priority;
|
cores[core].highest_priority = priority;
|
||||||
|
|
||||||
if (priority == cores[core].highest_priority ||
|
if (priority == cores[core].highest_priority ||
|
||||||
|
thread->priority_x < cores[core].highest_priority ||
|
||||||
(current_tick - thread->last_run > priority * 8))
|
(current_tick - thread->last_run > priority * 8))
|
||||||
{
|
{
|
||||||
cores[core].running = thread;
|
cores[core].running = thread;
|
||||||
|
|
@ -2402,7 +2403,6 @@ void priority_yield(void)
|
||||||
thread->priority_x = HIGHEST_PRIORITY;
|
thread->priority_x = HIGHEST_PRIORITY;
|
||||||
switch_thread(NULL);
|
switch_thread(NULL);
|
||||||
thread->priority_x = LOWEST_PRIORITY;
|
thread->priority_x = LOWEST_PRIORITY;
|
||||||
cores[core].highest_priority = LOWEST_PRIORITY;
|
|
||||||
}
|
}
|
||||||
#endif /* HAVE_PRIORITY_SCHEDULING */
|
#endif /* HAVE_PRIORITY_SCHEDULING */
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue