1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 15:38:12 +00:00

Kernel: Avoid deadlock when trying to send packets from the NetworkTask

fixes #6758
This commit is contained in:
Gunnar Beutner 2021-04-30 19:18:23 +02:00 committed by Andreas Kling
parent 4d697855ea
commit d8f92bdf96
4 changed files with 21 additions and 2 deletions

View file

@ -29,12 +29,20 @@ static void handle_icmp(const EthernetFrameHeader&, const IPv4Packet&, const Tim
static void handle_udp(const IPv4Packet&, const Time& packet_timestamp);
static void handle_tcp(const IPv4Packet&, const Time& packet_timestamp);
static Thread* network_task = nullptr;
[[noreturn]] static void NetworkTask_main(void*);
void NetworkTask::spawn()
{
RefPtr<Thread> thread;
Process::create_kernel_process(thread, "NetworkTask", NetworkTask_main, nullptr);
network_task = thread;
}
bool NetworkTask::is_current()
{
return Thread::current() == network_task;
}
void NetworkTask_main(void*)