diff options
author | Jean-Baptiste Boric <jblbeurope@gmail.com> | 2021-07-18 10:30:27 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-07 11:48:00 +0200 |
commit | 738e604bfc9c568a1267fa6ada5f66860d4692b7 (patch) | |
tree | 9130749e79ae365accf11cd1bdebf429af2c5354 /Kernel/GlobalProcessExposed.cpp | |
parent | 75260bff92fa75033c92cf09d0ab6cf55b515c85 (diff) | |
download | serenity-738e604bfc9c568a1267fa6ada5f66860d4692b7.zip |
Kernel: Migrate ARP table locking to ProtectedValue
Diffstat (limited to 'Kernel/GlobalProcessExposed.cpp')
-rw-r--r-- | Kernel/GlobalProcessExposed.cpp | 5 |
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; } |