From 11eee67b8510767d76fb4793e3b62ac1793dd723 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 19 Aug 2022 20:53:40 +0200 Subject: Kernel: Make self-contained locking smart pointers their own classes Until now, our kernel has reimplemented a number of AK classes to provide automatic internal locking: - RefPtr - NonnullRefPtr - WeakPtr - Weakable This patch renames the Kernel classes so that they can coexist with the original AK classes: - RefPtr => LockRefPtr - NonnullRefPtr => NonnullLockRefPtr - WeakPtr => LockWeakPtr - Weakable => LockWeakable The goal here is to eventually get rid of the Lock* classes in favor of using external locking. --- Kernel/Net/LocalSocket.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Kernel/Net/LocalSocket.h') diff --git a/Kernel/Net/LocalSocket.h b/Kernel/Net/LocalSocket.h index ac94bfcd30..451c3b3fff 100644 --- a/Kernel/Net/LocalSocket.h +++ b/Kernel/Net/LocalSocket.h @@ -15,19 +15,19 @@ namespace Kernel { class OpenFileDescription; struct SocketPair { - NonnullRefPtr description0; - NonnullRefPtr description1; + NonnullLockRefPtr description0; + NonnullLockRefPtr description1; }; class LocalSocket final : public Socket { public: - static ErrorOr> try_create(int type); + static ErrorOr> try_create(int type); static ErrorOr try_create_connected_pair(int type); virtual ~LocalSocket() override; - ErrorOr sendfd(OpenFileDescription const& socket_description, NonnullRefPtr passing_description); - ErrorOr> recvfd(OpenFileDescription const& socket_description); + ErrorOr sendfd(OpenFileDescription const& socket_description, NonnullLockRefPtr passing_description); + ErrorOr> recvfd(OpenFileDescription const& socket_description); static void for_each(Function); static ErrorOr try_for_each(Function(LocalSocket const&)>); @@ -59,8 +59,8 @@ private: bool has_attached_peer(OpenFileDescription const&) const; DoubleBuffer* receive_buffer_for(OpenFileDescription&); DoubleBuffer* send_buffer_for(OpenFileDescription&); - NonnullRefPtrVector& sendfd_queue_for(OpenFileDescription const&); - NonnullRefPtrVector& recvfd_queue_for(OpenFileDescription const&); + NonnullLockRefPtrVector& sendfd_queue_for(OpenFileDescription const&); + NonnullLockRefPtrVector& recvfd_queue_for(OpenFileDescription const&); void set_connect_side_role(Role connect_side_role, bool force_evaluate_block_conditions = false) { @@ -73,7 +73,7 @@ private: ErrorOr try_set_path(StringView); // The inode this socket is bound to. - WeakPtr m_inode; + LockWeakPtr m_inode; UserID m_prebind_uid { 0 }; GroupID m_prebind_gid { 0 }; @@ -100,8 +100,8 @@ private: NonnullOwnPtr m_for_client; NonnullOwnPtr m_for_server; - NonnullRefPtrVector m_fds_for_client; - NonnullRefPtrVector m_fds_for_server; + NonnullLockRefPtrVector m_fds_for_client; + NonnullLockRefPtrVector m_fds_for_server; IntrusiveListNode m_list_node; -- cgit v1.2.3