summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorAndrew Kaster <andrewdkaster@gmail.com>2021-01-10 12:23:47 -0700
committerAndreas Kling <kling@serenityos.org>2021-01-10 21:50:08 +0100
commita5e557472cca4532b9e397d49ff4ac3f1fb53c7e (patch)
tree660b683693dc5d776ba4d320072f81cd22c32767 /Kernel
parentd8aed14dba0922e9eb3fa6a9a92968e70811f744 (diff)
downloadserenity-a5e557472cca4532b9e397d49ff4ac3f1fb53c7e.zip
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
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/TTY/VirtualConsole.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/TTY/VirtualConsole.cpp b/Kernel/TTY/VirtualConsole.cpp
index f6e530b2ee..13a43ac49f 100644
--- a/Kernel/TTY/VirtualConsole.cpp
+++ b/Kernel/TTY/VirtualConsole.cpp
@@ -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)