mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 20:42:56 +01:00
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:
committed by
Norman Feske
parent
0d295f75a1
commit
98cb37b9e4
@@ -57,7 +57,12 @@ class Timer::Session_component : public Genode::Rpc_object<Session>,
|
||||
void trigger_periodic(unsigned us) override {
|
||||
_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 {
|
||||
return (_timeout_scheduler.curr_time().value - _init_time_us) / 1000; }
|
||||
|
||||
Reference in New Issue
Block a user