mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Kernel: Allow WorkQueue items allocation failures propagation
In most cases it's safe to abort the requested operation and go forward, however, in some places it's not clear yet how to handle these failures, therefore, we use the MUST() wrapper to force a kernel panic for now.
This commit is contained in:
parent
02566d8091
commit
1462211ccf
9 changed files with 75 additions and 19 deletions
|
@ -71,9 +71,10 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte)
|
|||
break;
|
||||
default:
|
||||
if ((m_modifiers & Mod_Alt) != 0 && ch >= 2 && ch <= ConsoleManagement::s_max_virtual_consoles + 1) {
|
||||
g_io_work->queue([ch]() {
|
||||
// FIXME: Do something sanely here if we can't allocate a work queue?
|
||||
MUST(g_io_work->try_queue([ch]() {
|
||||
ConsoleManagement::the().switch_to(ch - 0x02);
|
||||
});
|
||||
}));
|
||||
}
|
||||
key_state_changed(ch, pressed);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue