summaryrefslogtreecommitdiff
path: root/Kernel/Net
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-17 21:09:51 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-17 21:10:32 +0200
commitcee9528168d16ba4fb306df1ae5e2d0afe569dce (patch)
treedc2346f141a673bbc15a9b8db9e4ffb986f52de1 /Kernel/Net
parenta803c4026cf44d47d8f6bcad0854078742699fb0 (diff)
downloadserenity-cee9528168d16ba4fb306df1ae5e2d0afe569dce.zip
Kernel: Rename Lock to Mutex
Let's be explicit about what kind of lock this is meant to be.
Diffstat (limited to 'Kernel/Net')
-rw-r--r--Kernel/Net/IPv4Socket.h2
-rw-r--r--Kernel/Net/IPv4SocketTuple.h2
-rw-r--r--Kernel/Net/LocalSocket.cpp2
-rw-r--r--Kernel/Net/NetworkTask.cpp4
-rw-r--r--Kernel/Net/NetworkingManagement.h2
-rw-r--r--Kernel/Net/Socket.h6
-rw-r--r--Kernel/Net/TCPSocket.cpp8
-rw-r--r--Kernel/Net/TCPSocket.h2
-rw-r--r--Kernel/Net/UDPSocket.cpp4
9 files changed, 16 insertions, 16 deletions
diff --git a/Kernel/Net/IPv4Socket.h b/Kernel/Net/IPv4Socket.h
index 19005f683b..7f025882ee 100644
--- a/Kernel/Net/IPv4Socket.h
+++ b/Kernel/Net/IPv4Socket.h
@@ -10,7 +10,7 @@
#include <AK/SinglyLinkedListWithCount.h>
#include <Kernel/DoubleBuffer.h>
#include <Kernel/KBuffer.h>
-#include <Kernel/Lock.h>
+#include <Kernel/Mutex.h>
#include <Kernel/Net/IPv4.h>
#include <Kernel/Net/IPv4SocketTuple.h>
#include <Kernel/Net/Socket.h>
diff --git a/Kernel/Net/IPv4SocketTuple.h b/Kernel/Net/IPv4SocketTuple.h
index d845ca617e..9a964bde89 100644
--- a/Kernel/Net/IPv4SocketTuple.h
+++ b/Kernel/Net/IPv4SocketTuple.h
@@ -9,7 +9,7 @@
#include <AK/HashMap.h>
#include <Kernel/DoubleBuffer.h>
#include <Kernel/KBuffer.h>
-#include <Kernel/Lock.h>
+#include <Kernel/Mutex.h>
#include <Kernel/Net/IPv4.h>
#include <Kernel/Net/Socket.h>
diff --git a/Kernel/Net/LocalSocket.cpp b/Kernel/Net/LocalSocket.cpp
index 5d25631c8f..fdeb216e95 100644
--- a/Kernel/Net/LocalSocket.cpp
+++ b/Kernel/Net/LocalSocket.cpp
@@ -26,7 +26,7 @@ static Lockable<LocalSocket::List>& all_sockets()
void LocalSocket::for_each(Function<void(const LocalSocket&)> callback)
{
- Locker locker(all_sockets().lock(), Lock::Mode::Shared);
+ Locker locker(all_sockets().lock(), Mutex::Mode::Shared);
for (auto& socket : all_sockets().resource())
callback(socket);
}
diff --git a/Kernel/Net/NetworkTask.cpp b/Kernel/Net/NetworkTask.cpp
index f65d846b4e..f6f8063eee 100644
--- a/Kernel/Net/NetworkTask.cpp
+++ b/Kernel/Net/NetworkTask.cpp
@@ -5,7 +5,7 @@
*/
#include <Kernel/Debug.h>
-#include <Kernel/Lock.h>
+#include <Kernel/Mutex.h>
#include <Kernel/Net/ARP.h>
#include <Kernel/Net/EtherType.h>
#include <Kernel/Net/EthernetFrameHeader.h>
@@ -224,7 +224,7 @@ void handle_icmp(const EthernetFrameHeader& eth, const IPv4Packet& ipv4_packet,
{
NonnullRefPtrVector<IPv4Socket> icmp_sockets;
{
- Locker locker(IPv4Socket::all_sockets().lock(), Lock::Mode::Shared);
+ Locker locker(IPv4Socket::all_sockets().lock(), Mutex::Mode::Shared);
for (auto* socket : IPv4Socket::all_sockets().resource()) {
if (socket->protocol() != (unsigned)IPv4Protocol::ICMP)
continue;
diff --git a/Kernel/Net/NetworkingManagement.h b/Kernel/Net/NetworkingManagement.h
index f16a8a5fc6..a7ea001bcc 100644
--- a/Kernel/Net/NetworkingManagement.h
+++ b/Kernel/Net/NetworkingManagement.h
@@ -40,7 +40,7 @@ private:
NonnullRefPtrVector<NetworkAdapter> m_adapters;
RefPtr<NetworkAdapter> m_loopback_adapter;
- mutable Lock m_lock { "Networking" };
+ mutable Mutex m_lock { "Networking" };
};
}
diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h
index 0179b7923f..cd45156a45 100644
--- a/Kernel/Net/Socket.h
+++ b/Kernel/Net/Socket.h
@@ -12,7 +12,7 @@
#include <AK/Time.h>
#include <Kernel/FileSystem/File.h>
#include <Kernel/KResult.h>
-#include <Kernel/Lock.h>
+#include <Kernel/Mutex.h>
#include <Kernel/Net/NetworkAdapter.h>
#include <Kernel/UnixTypes.h>
@@ -99,7 +99,7 @@ public:
gid_t acceptor_gid() const { return m_acceptor.gid; }
const RefPtr<NetworkAdapter> bound_interface() const { return m_bound_interface; }
- Lock& lock() { return m_lock; }
+ Mutex& lock() { return m_lock; }
// ^File
virtual KResultOr<size_t> read(FileDescription&, u64, UserOrKernelBuffer&, size_t) override final;
@@ -137,7 +137,7 @@ protected:
private:
virtual bool is_socket() const final { return true; }
- Lock m_lock { "Socket" };
+ Mutex m_lock { "Socket" };
int m_domain { 0 };
int m_type { 0 };
diff --git a/Kernel/Net/TCPSocket.cpp b/Kernel/Net/TCPSocket.cpp
index 5539b51573..0d470ab88e 100644
--- a/Kernel/Net/TCPSocket.cpp
+++ b/Kernel/Net/TCPSocket.cpp
@@ -23,7 +23,7 @@ namespace Kernel {
void TCPSocket::for_each(Function<void(const TCPSocket&)> callback)
{
- Locker locker(sockets_by_tuple().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_tuple().lock(), Mutex::Mode::Shared);
for (auto& it : sockets_by_tuple().resource())
callback(*it.value);
}
@@ -68,7 +68,7 @@ Lockable<HashMap<IPv4SocketTuple, TCPSocket*>>& TCPSocket::sockets_by_tuple()
RefPtr<TCPSocket> TCPSocket::from_tuple(const IPv4SocketTuple& tuple)
{
- Locker locker(sockets_by_tuple().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_tuple().lock(), Mutex::Mode::Shared);
auto exact_match = sockets_by_tuple().resource().get(tuple);
if (exact_match.has_value())
@@ -91,7 +91,7 @@ RefPtr<TCPSocket> TCPSocket::create_client(const IPv4Address& new_local_address,
auto tuple = IPv4SocketTuple(new_local_address, new_local_port, new_peer_address, new_peer_port);
{
- Locker locker(sockets_by_tuple().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_tuple().lock(), Mutex::Mode::Shared);
if (sockets_by_tuple().resource().contains(tuple))
return {};
}
@@ -545,7 +545,7 @@ void TCPSocket::retransmit_packets()
if (routing_decision.is_zero())
return;
- Locker locker(m_not_acked_lock, Lock::Mode::Shared);
+ Locker locker(m_not_acked_lock, Mutex::Mode::Shared);
for (auto& packet : m_not_acked) {
packet.tx_counter++;
diff --git a/Kernel/Net/TCPSocket.h b/Kernel/Net/TCPSocket.h
index 5441a991c7..94dbe9885d 100644
--- a/Kernel/Net/TCPSocket.h
+++ b/Kernel/Net/TCPSocket.h
@@ -202,7 +202,7 @@ private:
int tx_counter { 0 };
};
- mutable Lock m_not_acked_lock { "TCPSocket unacked packets" };
+ mutable Mutex m_not_acked_lock { "TCPSocket unacked packets" };
SinglyLinkedList<OutgoingPacket> m_not_acked;
size_t m_not_acked_size { 0 };
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp
index a39ed22300..fda3f832aa 100644
--- a/Kernel/Net/UDPSocket.cpp
+++ b/Kernel/Net/UDPSocket.cpp
@@ -17,7 +17,7 @@ namespace Kernel {
void UDPSocket::for_each(Function<void(const UDPSocket&)> callback)
{
- Locker locker(sockets_by_port().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_port().lock(), Mutex::Mode::Shared);
for (auto it : sockets_by_port().resource())
callback(*it.value);
}
@@ -33,7 +33,7 @@ SocketHandle<UDPSocket> UDPSocket::from_port(u16 port)
{
RefPtr<UDPSocket> socket;
{
- Locker locker(sockets_by_port().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_port().lock(), Mutex::Mode::Shared);
auto it = sockets_by_port().resource().find(port);
if (it == sockets_by_port().resource().end())
return {};