mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-11 13:22:33 +00:00
os: reprogram timer solely if needed
If an alarm/timeout object became head of the timeout queue, then the low level timer must be reprogrammed. Issue #1106
This commit is contained in:
parent
cd0d378142
commit
a604ea6851
os
@ -131,6 +131,14 @@ namespace Genode {
|
||||
* \return true if an alarm is scheduled
|
||||
*/
|
||||
bool next_deadline(Alarm::Time *deadline);
|
||||
|
||||
/**
|
||||
* Determine if given alarm object is current head element
|
||||
*
|
||||
* \param alarm alarm object
|
||||
* \return true if alarm is head element of timeout queue
|
||||
*/
|
||||
bool head_timeout(const Alarm * alarm) { return _head == alarm; }
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -193,7 +193,8 @@ namespace Timer {
|
||||
} else schedule_absolute(alarm, now + timeout);
|
||||
|
||||
/* interrupt current 'wait_for_timeout' */
|
||||
_platform_timer->schedule_timeout(0);
|
||||
if (head_timeout(alarm))
|
||||
_platform_timer->schedule_timeout(0);
|
||||
}
|
||||
|
||||
unsigned long curr_time() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user