mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27: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
|
@ -151,7 +151,8 @@ void Console::process_control_message(ControlMessage message)
|
|||
{
|
||||
switch (message.event) {
|
||||
case (u16)ControlEvent::DeviceAdd: {
|
||||
g_io_work->queue([message, this]() -> void {
|
||||
// FIXME: Do something sanely here if we can't allocate a work queue?
|
||||
MUST(g_io_work->try_queue([message, this]() -> void {
|
||||
u32 id = message.id;
|
||||
if (id >= m_ports.size()) {
|
||||
dbgln("Device provided an invalid port number {}. max_nr_ports: {}", id, m_ports.size());
|
||||
|
@ -172,7 +173,7 @@ void Console::process_control_message(ControlMessage message)
|
|||
.value = (u16)ControlMessage::Status::Success
|
||||
};
|
||||
write_control_message(ready_event);
|
||||
});
|
||||
}));
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue