monitor: handle Monitored_thread case in kill_thread()

Fixes #4934
This commit is contained in:
Christian Prochaska 2023-06-26 12:44:06 +02:00 committed by Norman Feske
parent 8264b63e0b
commit 59ce64b638

View File

@ -73,8 +73,16 @@ struct Monitor::Inferior_cpu : Monitored_cpu_session
return result;
}
void kill_thread(Thread_capability thread) override {
_real.call<Rpc_kill_thread>(thread); }
void kill_thread(Thread_capability thread) override
{
Monitored_thread::with_thread(_ep, thread,
[&] (Monitored_thread &monitored_thread) {
_real.call<Rpc_kill_thread>(monitored_thread._real);
destroy(_alloc, &monitored_thread); },
[&] {
_real.call<Rpc_kill_thread>(thread); }
);
}
void exception_sigh(Signal_context_capability sigh) override {
_real.call<Rpc_exception_sigh>(sigh); }