diff options
author | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-02-14 15:02:14 -0800 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-15 08:28:57 +0100 |
commit | ddd79fe2cfa4759ed0fabbb875403248a918fa00 (patch) | |
tree | 036a81b28f2313c9d8a5b33806e7830dab43b2bb /Kernel/Net | |
parent | 4ac286903d4ba055b89f134a8022e64726581708 (diff) | |
download | serenity-ddd79fe2cfa4759ed0fabbb875403248a918fa00.zip |
Kernel: Add WaitQueue::wait_forever and it use it for all infinite waits.
In preparation for marking BlockingResult [[nodiscard]], there are a few
places that perform infinite waits, which we never observe the result of
the wait. Instead of suppressing them, add an alternate function which
returns void when performing and infinite wait.
Diffstat (limited to 'Kernel/Net')
-rw-r--r-- | Kernel/Net/E1000NetworkAdapter.cpp | 2 | ||||
-rw-r--r-- | Kernel/Net/NE2000NetworkAdapter.cpp | 2 | ||||
-rw-r--r-- | Kernel/Net/NetworkTask.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/E1000NetworkAdapter.cpp b/Kernel/Net/E1000NetworkAdapter.cpp index 7ffb13dbff..47844809eb 100644 --- a/Kernel/Net/E1000NetworkAdapter.cpp +++ b/Kernel/Net/E1000NetworkAdapter.cpp @@ -444,7 +444,7 @@ void E1000NetworkAdapter::send_raw(ReadonlyBytes payload) sti(); break; } - m_wait_queue.wait_on({}, "E1000NetworkAdapter"); + m_wait_queue.wait_forever("E1000NetworkAdapter"); } #if E1000_DEBUG dbgln("E1000: Sent packet, status is now {:#02x}!", (u8)descriptor.status); diff --git a/Kernel/Net/NE2000NetworkAdapter.cpp b/Kernel/Net/NE2000NetworkAdapter.cpp index cbf100c614..86b7222441 100644 --- a/Kernel/Net/NE2000NetworkAdapter.cpp +++ b/Kernel/Net/NE2000NetworkAdapter.cpp @@ -392,7 +392,7 @@ void NE2000NetworkAdapter::send_raw(ReadonlyBytes payload) } while (in8(REG_RW_COMMAND) & BIT_COMMAND_TXP) - m_wait_queue.wait_on({}, "NE2000NetworkAdapter"); + m_wait_queue.wait_forever("NE2000NetworkAdapter"); disable_irq(); size_t packet_size = payload.size(); diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp index a4a9975dd2..f3254fb442 100644 --- a/Kernel/Net/NetworkTask.cpp +++ b/Kernel/Net/NetworkTask.cpp @@ -106,7 +106,7 @@ void NetworkTask_main(void*) for (;;) { size_t packet_size = dequeue_packet(buffer, buffer_size, packet_timestamp); if (!packet_size) { - packet_wait_queue.wait_on({}, "NetworkTask"); + packet_wait_queue.wait_forever("NetworkTask"); continue; } if (packet_size < sizeof(EthernetFrameHeader)) { |