mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
Kernel: Switch LocalSocket to IntrusiveList from InlineLinkedList
This commit is contained in:
parent
493d4d1cd7
commit
e0da61f9d6
2 changed files with 13 additions and 13 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/InlineLinkedList.h>
|
||||
#include <AK/IntrusiveList.h>
|
||||
#include <Kernel/DoubleBuffer.h>
|
||||
#include <Kernel/Net/Socket.h>
|
||||
|
||||
|
@ -19,9 +19,7 @@ struct SocketPair {
|
|||
NonnullRefPtr<FileDescription> description2;
|
||||
};
|
||||
|
||||
class LocalSocket final : public Socket
|
||||
, public InlineLinkedListNode<LocalSocket> {
|
||||
friend class InlineLinkedListNode<LocalSocket>;
|
||||
class LocalSocket final : public Socket {
|
||||
|
||||
public:
|
||||
static KResultOr<NonnullRefPtr<Socket>> create(int type);
|
||||
|
@ -57,7 +55,6 @@ private:
|
|||
virtual const char* class_name() const override { return "LocalSocket"; }
|
||||
virtual bool is_local() const override { return true; }
|
||||
bool has_attached_peer(const FileDescription&) const;
|
||||
static Lockable<InlineLinkedList<LocalSocket>>& all_sockets();
|
||||
DoubleBuffer* receive_buffer_for(FileDescription&);
|
||||
DoubleBuffer* send_buffer_for(FileDescription&);
|
||||
NonnullRefPtrVector<FileDescription>& sendfd_queue_for(const FileDescription&);
|
||||
|
@ -102,9 +99,10 @@ private:
|
|||
NonnullRefPtrVector<FileDescription> m_fds_for_client;
|
||||
NonnullRefPtrVector<FileDescription> m_fds_for_server;
|
||||
|
||||
// for InlineLinkedList
|
||||
LocalSocket* m_prev { nullptr };
|
||||
LocalSocket* m_next { nullptr };
|
||||
IntrusiveListNode<LocalSocket> m_list_node;
|
||||
|
||||
public:
|
||||
using List = IntrusiveList<LocalSocket, RawPtr<LocalSocket>, &LocalSocket::m_list_node>;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue