mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-02 08:42:52 +00:00
lx_kit: preserve priority order in scheduler
This commit is contained in:
parent
68925a6d33
commit
5ff1ef82d1
@ -128,15 +128,6 @@ void Scheduler::_execute()
|
|||||||
{
|
{
|
||||||
_idle_pre_post_process();
|
_idle_pre_post_process();
|
||||||
|
|
||||||
/*
|
|
||||||
* Iterate over all tasks and run first runnable.
|
|
||||||
*
|
|
||||||
* (1) If one runnable tasks was run start over from beginning of
|
|
||||||
* list.
|
|
||||||
*
|
|
||||||
* (2) If no task is runnable quit scheduling (break endless
|
|
||||||
* loop).
|
|
||||||
*/
|
|
||||||
while (true) {
|
while (true) {
|
||||||
bool at_least_one = false;
|
bool at_least_one = false;
|
||||||
|
|
||||||
@ -151,6 +142,7 @@ void Scheduler::_execute()
|
|||||||
Genode::destroy(Lx_kit::env().heap, tmp);
|
Genode::destroy(Lx_kit::env().heap, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* iterate over all tasks and run first runnable */
|
||||||
for (Task * t = _present_list.first(); t; t = t->next()) {
|
for (Task * t = _present_list.first(); t; t = t->next()) {
|
||||||
|
|
||||||
if (!t->runnable())
|
if (!t->runnable())
|
||||||
@ -161,10 +153,11 @@ void Scheduler::_execute()
|
|||||||
t->run();
|
t->run();
|
||||||
at_least_one = true;
|
at_least_one = true;
|
||||||
|
|
||||||
if (!t->runnable())
|
/* start over after one task was executed to preserve priority order */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* no task was runnable - quit scheduling (break endless loop) */
|
||||||
if (!at_least_one)
|
if (!at_least_one)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user