Kernel: Defer handling of key press events in VirtualConsole

Trying to pass these onto the Terminal while handling an IRQ is a recipe
for disaster. Use Processor::deferred_call_queue to create an ad-hoc
"second half" of the interrupt handler.

Fixes #4889
This commit is contained in:
Andrew Kaster 2021-01-10 12:23:47 -07:00 committed by Andreas Kling
parent d8aed14dba
commit a5e557472c
Notes: sideshowbarker 2024-07-18 23:57:19 +09:00

View file

@ -238,7 +238,9 @@ void VirtualConsole::on_key_pressed(KeyboardDevice::Event event)
return;
}
m_terminal.handle_key_press(event.key, event.code_point, event.flags);
Processor::deferred_call_queue([this, event]() {
m_terminal.handle_key_press(event.key, event.code_point, event.flags);
});
}
ssize_t VirtualConsole::on_tty_write(const UserOrKernelBuffer& data, ssize_t size)