drivers/timer: do not submit signals for invalid contexts
Setting a timer signal handler with an invalid capability cancels signaling and any periodic timeout. Fix #2192
This commit is contained in:
parent
0d295f75a1
commit
98cb37b9e4
|
@ -57,7 +57,12 @@ class Timer::Session_component : public Genode::Rpc_object<Session>,
|
||||||
void trigger_periodic(unsigned us) override {
|
void trigger_periodic(unsigned us) override {
|
||||||
_timeout.schedule_periodic(Microseconds(us), *this); }
|
_timeout.schedule_periodic(Microseconds(us), *this); }
|
||||||
|
|
||||||
void sigh(Signal_context_capability sigh) override { _sigh = sigh; }
|
void sigh(Signal_context_capability sigh) override
|
||||||
|
{
|
||||||
|
_sigh = sigh;
|
||||||
|
if (!sigh.valid())
|
||||||
|
_timeout_scheduler.discard(_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
unsigned long elapsed_ms() const override {
|
unsigned long elapsed_ms() const override {
|
||||||
return (_timeout_scheduler.curr_time().value - _init_time_us) / 1000; }
|
return (_timeout_scheduler.curr_time().value - _init_time_us) / 1000; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user