summaryrefslogtreecommitdiff
path: root/Kernel/GlobalProcessExposed.cpp
diff options
context:
space:
mode:
authorJean-Baptiste Boric <jblbeurope@gmail.com>2021-07-18 10:30:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-07 11:48:00 +0200
commit738e604bfc9c568a1267fa6ada5f66860d4692b7 (patch)
tree9130749e79ae365accf11cd1bdebf429af2c5354 /Kernel/GlobalProcessExposed.cpp
parent75260bff92fa75033c92cf09d0ab6cf55b515c85 (diff)
downloadserenity-738e604bfc9c568a1267fa6ada5f66860d4692b7.zip
Kernel: Migrate ARP table locking to ProtectedValue
Diffstat (limited to 'Kernel/GlobalProcessExposed.cpp')
-rw-r--r--Kernel/GlobalProcessExposed.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Kernel/GlobalProcessExposed.cpp b/Kernel/GlobalProcessExposed.cpp
index 80ae165b3c..c4c6516c41 100644
--- a/Kernel/GlobalProcessExposed.cpp
+++ b/Kernel/GlobalProcessExposed.cpp
@@ -76,12 +76,11 @@ private:
virtual bool output(KBufferBuilder& builder) override
{
JsonArraySerializer array { builder };
- MutexLocker locker(arp_table().lock(), Mutex::Mode::Shared);
- for (auto& it : arp_table().resource()) {
+ arp_table().for_each_shared([&](const auto& it) {
auto obj = array.add_object();
obj.add("mac_address", it.value.to_string());
obj.add("ip_address", it.key.to_string());
- }
+ });
array.finish();
return true;
}