summaryrefslogtreecommitdiff
path: root/Kernel/Net/UDPSocket.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-04-24 15:27:32 -0700
committerAndreas Kling <kling@serenityos.org>2021-04-25 09:38:27 +0200
commit8d6e9fad40d493e6f2027cec37212956294a591f (patch)
tree71816f325880a99ef5b623d9795f2eded3d69ca7 /Kernel/Net/UDPSocket.cpp
parent0d5827f8652462715f6c2f91e2b91b2077547ae6 (diff)
downloadserenity-8d6e9fad40d493e6f2027cec37212956294a591f.zip
Kernel: Remove the now defunct `LOCKER(..)` macro.
Diffstat (limited to 'Kernel/Net/UDPSocket.cpp')
-rw-r--r--Kernel/Net/UDPSocket.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp
index 309823d626..fe6068974b 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(sockets_by_port().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_port().lock(), Lock::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(sockets_by_port().lock(), Lock::Mode::Shared);
+ Locker locker(sockets_by_port().lock(), Lock::Mode::Shared);
auto it = sockets_by_port().resource().find(port);
if (it == sockets_by_port().resource().end())
return {};
@@ -50,7 +50,7 @@ UDPSocket::UDPSocket(int protocol)
UDPSocket::~UDPSocket()
{
- LOCKER(sockets_by_port().lock());
+ Locker locker(sockets_by_port().lock());
sockets_by_port().resource().remove(local_port());
}
@@ -104,7 +104,7 @@ int UDPSocket::protocol_allocate_local_port()
static const u16 ephemeral_port_range_size = last_ephemeral_port - first_ephemeral_port;
u16 first_scan_port = first_ephemeral_port + get_good_random<u16>() % ephemeral_port_range_size;
- LOCKER(sockets_by_port().lock());
+ Locker locker(sockets_by_port().lock());
for (u16 port = first_scan_port;;) {
auto it = sockets_by_port().resource().find(port);
if (it == sockets_by_port().resource().end()) {
@@ -123,7 +123,7 @@ int UDPSocket::protocol_allocate_local_port()
KResult UDPSocket::protocol_bind()
{
- LOCKER(sockets_by_port().lock());
+ Locker locker(sockets_by_port().lock());
if (sockets_by_port().resource().contains(local_port()))
return EADDRINUSE;
sockets_by_port().resource().set(local_port(), this);