1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:07:45 +00:00

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.
This commit is contained in:
Brian Gianforcaro 2021-02-14 15:02:14 -08:00 committed by Andreas Kling
parent 4ac286903d
commit ddd79fe2cf
9 changed files with 15 additions and 9 deletions

View file

@ -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);

View file

@ -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();

View file

@ -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)) {