mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 22:47:50 +00:00
parent
0d5f185267
commit
e42a205a51
@ -116,7 +116,12 @@ Cpu::Idle_thread::Idle_thread(Cpu &cpu)
|
||||
void Cpu::schedule(Job * const job)
|
||||
{
|
||||
if (_id == executing_id()) { _scheduler.ready(job->share()); }
|
||||
else if (_scheduler.ready_check(job->share())) { trigger_ip_interrupt(); }
|
||||
else {
|
||||
_scheduler.ready_check(job->share());
|
||||
if (_scheduler.need_to_schedule()) {
|
||||
trigger_ip_interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,14 +153,15 @@ void Cpu_scheduler::update(time_t time)
|
||||
}
|
||||
|
||||
|
||||
bool Cpu_scheduler::ready_check(Share &s1)
|
||||
void Cpu_scheduler::ready_check(Share &s1)
|
||||
{
|
||||
assert(_head);
|
||||
|
||||
ready(s1);
|
||||
|
||||
if (_need_to_schedule) return _need_to_schedule;
|
||||
|
||||
if (_need_to_schedule) {
|
||||
return;
|
||||
}
|
||||
Share * s2 = _head;
|
||||
if (!s1._claim) {
|
||||
_need_to_schedule = s2 == &_idle;
|
||||
@ -178,7 +179,6 @@ bool Cpu_scheduler::ready_check(Share &s1)
|
||||
|
||||
_need_to_schedule = !s2;
|
||||
}
|
||||
return _need_to_schedule;
|
||||
}
|
||||
|
||||
|
||||
|
@ -177,7 +177,7 @@ class Kernel::Cpu_scheduler
|
||||
/**
|
||||
* Set 's1' ready and return wether this outdates current head
|
||||
*/
|
||||
bool ready_check(Share &s1);
|
||||
void ready_check(Share &s1);
|
||||
|
||||
/**
|
||||
* Set share 's' ready
|
||||
|
@ -119,9 +119,9 @@ void update_check(unsigned const l, unsigned const c, unsigned const t,
|
||||
|
||||
void ready_check(unsigned const l, unsigned const s, bool const x)
|
||||
{
|
||||
bool const y = data()->scheduler.ready_check(*share(s));
|
||||
if (y != x) {
|
||||
Genode::log("wrong check result ", y, " in line ", l);
|
||||
data()->scheduler.ready_check(*share(s));
|
||||
if (data()->scheduler.need_to_schedule() != x) {
|
||||
Genode::log("wrong check result ", data()->scheduler.need_to_schedule(), " in line ", l);
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user