mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Kernel: Migrate ARP table locking to ProtectedValue
This commit is contained in:
committed by
Andreas Kling
parent
75260bff92
commit
738e604bfc
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user