mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 23:42:32 +00:00
alarm: limit sleep timeout to 60s
Instead of using an unreasonable value for the sleep time, limit it to 60s. Fixes #2188.
This commit is contained in:
parent
71d30297ff
commit
400198013b
@ -64,7 +64,10 @@ void Alarm_timeout_scheduler::handle_timeout(Microseconds curr_time)
|
||||
} else {
|
||||
sleep_time_us = _time_source.max_timeout().value; }
|
||||
|
||||
if (sleep_time_us == 0) {
|
||||
/* limit max timeout to a more reasonable value, e.g. 60s */
|
||||
if (sleep_time_us > 60000000) {
|
||||
sleep_time_us = 60000000;
|
||||
} else if (sleep_time_us == 0) {
|
||||
sleep_time_us = 1; }
|
||||
|
||||
_time_source.schedule_timeout(Microseconds(sleep_time_us), *this);
|
||||
|
Loading…
Reference in New Issue
Block a user