diff options
author | Tom <tomut@yahoo.com> | 2020-08-20 09:36:06 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-21 11:47:35 +0200 |
commit | f48feae0b2a300992479abf0b2ded85e45ac6045 (patch) | |
tree | d0b01169a60261135ee15a8d4a6abd01785a7bec /Kernel/Net/IPv4Socket.cpp | |
parent | 527c8047fe0a08ade2e17fd096ad9b4ebc103ec5 (diff) | |
download | serenity-f48feae0b2a300992479abf0b2ded85e45ac6045.zip |
Kernel: Switch singletons to use new Singleton class
Fixes #3226
Diffstat (limited to 'Kernel/Net/IPv4Socket.cpp')
-rw-r--r-- | Kernel/Net/IPv4Socket.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/IPv4Socket.cpp b/Kernel/Net/IPv4Socket.cpp index 6e4fcfcbfa..8286e5a2e8 100644 --- a/Kernel/Net/IPv4Socket.cpp +++ b/Kernel/Net/IPv4Socket.cpp @@ -25,6 +25,7 @@ */ #include <AK/StringBuilder.h> +#include <Kernel/Singleton.h> #include <Kernel/FileSystem/FileDescription.h> #include <Kernel/Net/ARP.h> #include <Kernel/Net/ICMP.h> @@ -45,11 +46,10 @@ namespace Kernel { +static auto s_table = make_singleton<Lockable<HashTable<IPv4Socket*>>>(); + Lockable<HashTable<IPv4Socket*>>& IPv4Socket::all_sockets() { - static Lockable<HashTable<IPv4Socket*>>* s_table; - if (!s_table) - s_table = new Lockable<HashTable<IPv4Socket*>>; return *s_table; } |