mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
parent
d2b82274db
commit
70540e6f8e
@ -39,20 +39,19 @@ namespace Genode {
|
||||
Timer::Connection _timer; /* timer session */
|
||||
Signal_context _context;
|
||||
Signal_receiver _receiver;
|
||||
Genode::Alarm::Time _time; /* current time */
|
||||
|
||||
void entry(void);
|
||||
|
||||
public:
|
||||
|
||||
Timeout_thread() : Thread<4096>("alarm-timer"), _time(0)
|
||||
Timeout_thread() : Thread<4096>("alarm-timer")
|
||||
{
|
||||
_timer.sigh(_receiver.manage(&_context));
|
||||
_timer.trigger_periodic(JIFFIES_STEP_MS*1000);
|
||||
start();
|
||||
}
|
||||
|
||||
Genode::Alarm::Time time(void) { return _time; }
|
||||
Genode::Alarm::Time time(void) { return _timer.elapsed_ms(); }
|
||||
|
||||
/*
|
||||
* Returns the singleton timeout-thread used for all timeouts.
|
||||
|
@ -19,11 +19,8 @@ void Genode::Timeout_thread::entry()
|
||||
while (true) {
|
||||
Signal s = _receiver.wait_for_signal();
|
||||
|
||||
/* increase jiffies counter related to received signals */
|
||||
_time += JIFFIES_STEP_MS * s.num();
|
||||
|
||||
/* handle timouts of this point in time */
|
||||
Genode::Alarm_scheduler::handle(_time);
|
||||
Genode::Alarm_scheduler::handle(_timer.elapsed_ms());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user