diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-04-18 12:50:35 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-18 13:58:29 +0200 |
commit | 54550365ebfe3ed18e2ae6b5d2d23990380cb800 (patch) | |
tree | b13ff23325432a2baee7308fbd1a72a5733dec86 /Kernel/Net/UDPSocket.cpp | |
parent | 05ba4295e9613710d6333ddd213f094708a4a27c (diff) | |
download | serenity-54550365ebfe3ed18e2ae6b5d2d23990380cb800.zip |
Kernel: Use shared locking mode in some places
The notable piece of code that remains to be converted is Ext2FS.
Diffstat (limited to 'Kernel/Net/UDPSocket.cpp')
-rw-r--r-- | Kernel/Net/UDPSocket.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/Net/UDPSocket.cpp b/Kernel/Net/UDPSocket.cpp index 2afd24bd89..61f012c898 100644 --- a/Kernel/Net/UDPSocket.cpp +++ b/Kernel/Net/UDPSocket.cpp @@ -34,9 +34,9 @@ namespace Kernel { -void UDPSocket::for_each(Function<void(UDPSocket&)> callback) +void UDPSocket::for_each(Function<void(const UDPSocket&)> callback) { - LOCKER(sockets_by_port().lock()); + LOCKER(sockets_by_port().lock(), Lock::Mode::Shared); for (auto it : sockets_by_port().resource()) callback(*it.value); } @@ -53,7 +53,7 @@ SocketHandle<UDPSocket> UDPSocket::from_port(u16 port) { RefPtr<UDPSocket> socket; { - LOCKER(sockets_by_port().lock()); + LOCKER(sockets_by_port().lock(), Lock::Mode::Shared); auto it = sockets_by_port().resource().find(port); if (it == sockets_by_port().resource().end()) return {}; |