mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Kernel: Migrate ARP table locking to ProtectedValue
This commit is contained in:
parent
75260bff92
commit
738e604bfc
Notes:
sideshowbarker
2024-07-18 07:20:33 +09:00
Author: https://github.com/boricj
Commit: 738e604bfc
Pull-request: https://github.com/SerenityOS/serenity/pull/8851
Reviewed-by: https://github.com/awesomekling ✅
Reviewed-by: https://github.com/bgianfo
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