mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Move NetworkTask startup into NetworkTask::spawn()
This commit is contained in:
parent
520c4254c9
commit
f25d2f5518
Notes:
sideshowbarker
2024-07-19 07:47:06 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f25d2f5518f
3 changed files with 15 additions and 7 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <Kernel/Net/IPv4.h>
|
||||
#include <Kernel/Net/IPv4Socket.h>
|
||||
#include <Kernel/Net/LoopbackAdapter.h>
|
||||
#include <Kernel/Net/NetworkTask.h>
|
||||
#include <Kernel/Net/Routing.h>
|
||||
#include <Kernel/Net/TCP.h>
|
||||
#include <Kernel/Net/TCPSocket.h>
|
||||
|
@ -56,6 +57,14 @@ static void handle_icmp(const EthernetFrameHeader&, const IPv4Packet&);
|
|||
static void handle_udp(const IPv4Packet&);
|
||||
static void handle_tcp(const IPv4Packet&);
|
||||
|
||||
[[noreturn]] static void NetworkTask_main();
|
||||
|
||||
void NetworkTask::spawn()
|
||||
{
|
||||
Thread* thread = nullptr;
|
||||
Process::create_kernel_process(thread, "NetworkTask", NetworkTask_main);
|
||||
}
|
||||
|
||||
void NetworkTask_main()
|
||||
{
|
||||
WaitQueue packet_wait_queue;
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#pragma once
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
void NetworkTask_main();
|
||||
|
||||
class NetworkTask {
|
||||
public:
|
||||
static void spawn();
|
||||
};
|
||||
}
|
||||
|
|
|
@ -318,10 +318,8 @@ void init_stage2()
|
|||
}
|
||||
thread->set_priority(THREAD_PRIORITY_HIGH);
|
||||
}
|
||||
{
|
||||
Thread* thread = nullptr;
|
||||
Process::create_kernel_process(thread, "NetworkTask", NetworkTask_main);
|
||||
}
|
||||
|
||||
NetworkTask::spawn();
|
||||
|
||||
Process::current->sys$exit(0);
|
||||
ASSERT_NOT_REACHED();
|
||||
|
|
Loading…
Reference in a new issue