mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:28:11 +00:00
Kernel: Migrate ARP table locking to ProtectedValue
This commit is contained in:
parent
75260bff92
commit
738e604bfc
3 changed files with 27 additions and 20 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue