mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 23:42:32 +00:00
lxip: schedule timeout + poll wait
* poll_wait + schedule_timeout + block on wait_and_dispatch_one_signal
This commit is contained in:
parent
ed370a8f5c
commit
3048017d90
@ -310,12 +310,10 @@ struct Timeout : Genode::Signal_handler<Timeout>
|
|||||||
Genode::Entrypoint &ep;
|
Genode::Entrypoint &ep;
|
||||||
Timer::Connection timer;
|
Timer::Connection timer;
|
||||||
void (*tick)();
|
void (*tick)();
|
||||||
bool pending = false;
|
|
||||||
|
|
||||||
void handle()
|
void handle()
|
||||||
{
|
{
|
||||||
update_jiffies();
|
update_jiffies();
|
||||||
pending = false;
|
|
||||||
|
|
||||||
/* tick the higher layer of the component */
|
/* tick the higher layer of the component */
|
||||||
tick();
|
tick();
|
||||||
@ -332,13 +330,11 @@ struct Timeout : Genode::Signal_handler<Timeout>
|
|||||||
void schedule(signed long msec)
|
void schedule(signed long msec)
|
||||||
{
|
{
|
||||||
timer.trigger_once(msec * 1000);
|
timer.trigger_once(msec * 1000);
|
||||||
pending = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wait()
|
void wait()
|
||||||
{
|
{
|
||||||
while (pending)
|
ep.wait_and_dispatch_one_signal();
|
||||||
ep.wait_and_dispatch_one_signal();
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user