1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:47:46 +00:00

AK: Revert Eternal<T> for now since it doesn't work as intended.

This commit is contained in:
Andreas Kling 2019-04-05 05:10:18 +02:00
parent fb6dc5350d
commit bcc00857a4
14 changed files with 51 additions and 67 deletions

View file

@ -1,10 +1,11 @@
#include <Kernel/Net/LoopbackAdapter.h>
#include <AK/Eternal.h>
LoopbackAdapter& LoopbackAdapter::the()
{
static Eternal<LoopbackAdapter> the;
return the;
static LoopbackAdapter* the;
if (!the)
the = new LoopbackAdapter;
return *the;
}
LoopbackAdapter::LoopbackAdapter()

View file

@ -6,11 +6,12 @@ class LoopbackAdapter final : public NetworkAdapter {
AK_MAKE_ETERNAL
public:
static LoopbackAdapter& the();
LoopbackAdapter();
virtual ~LoopbackAdapter() override;
virtual void send_raw(const byte*, int) override;
virtual const char* class_name() const override { return "LoopbackAdapter"; }
private:
virtual ~LoopbackAdapter() override;
LoopbackAdapter();
};

View file

@ -12,7 +12,7 @@
#include <Kernel/Process.h>
#include <Kernel/Net/EtherType.h>
#include <Kernel/Lock.h>
#include <AK/Eternal.h>
//#define ETHERNET_DEBUG
#define IPV4_DEBUG
@ -28,8 +28,10 @@ static void handle_tcp(const EthernetFrameHeader&, int frame_size);
Lockable<HashMap<IPv4Address, MACAddress>>& arp_table()
{
static Eternal<Lockable<HashMap<IPv4Address, MACAddress>>> the;
return the;
static Lockable<HashMap<IPv4Address, MACAddress>>* the;
if (!the)
the = new Lockable<HashMap<IPv4Address, MACAddress>>;
return *the;
}
void NetworkTask_main()