1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00

Kernel: Use shared locking mode in some places

The notable piece of code that remains to be converted is Ext2FS.
This commit is contained in:
Sergey Bugaev 2020-04-18 12:50:35 +03:00 committed by Andreas Kling
parent 05ba4295e9
commit 54550365eb
11 changed files with 26 additions and 26 deletions

View file

@ -491,7 +491,7 @@ Optional<KBuffer> procfs$net_arp(InodeIdentifier)
{
KBufferBuilder builder;
JsonArraySerializer array { builder };
LOCKER(arp_table().lock());
LOCKER(arp_table().lock(), Lock::Mode::Shared);
for (auto& it : arp_table().resource()) {
auto obj = array.add_object();
obj.add("mac_address", it.value.to_string());
@ -983,7 +983,7 @@ static ByteBuffer read_sys_bool(InodeIdentifier inode_id)
auto buffer = ByteBuffer::create_uninitialized(2);
auto* lockable_bool = reinterpret_cast<Lockable<bool>*>(variable.address);
{
LOCKER(lockable_bool->lock());
LOCKER(lockable_bool->lock(), Lock::Mode::Shared);
buffer[0] = lockable_bool->resource() ? '1' : '0';
}
buffer[1] = '\n';
@ -1013,7 +1013,7 @@ static ByteBuffer read_sys_string(InodeIdentifier inode_id)
ASSERT(variable.type == SysVariable::Type::String);
auto* lockable_string = reinterpret_cast<Lockable<String>*>(variable.address);
LOCKER(lockable_string->lock());
LOCKER(lockable_string->lock(), Lock::Mode::Shared);
return lockable_string->resource().to_byte_buffer();
}