mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Kernel: Use shared locking mode in some places
The notable piece of code that remains to be converted is Ext2FS.
This commit is contained in:
parent
05ba4295e9
commit
54550365eb
Notes:
sideshowbarker
2024-07-19 07:30:46 +09:00
Author: https://github.com/bugaevc
Commit: 54550365eb
Pull-request: https://github.com/SerenityOS/serenity/pull/1837
11 changed files with 26 additions and 26 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue