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

Kernel: Wrap HIDManagement keymap data in SpinlockProtected

This serializes access to the current keymap data everywhere in the
kernel, allowing to mark sys$setkeymap() as not needing the big lock.
This commit is contained in:
Andreas Kling 2022-03-07 16:34:14 +01:00
parent ff60e8ffc6
commit baa6ff5649
5 changed files with 52 additions and 36 deletions

View file

@ -661,7 +661,9 @@ private:
virtual ErrorOr<void> try_generate(KBufferBuilder& builder) override
{
auto json = TRY(JsonObjectSerializer<>::try_create(builder));
TRY(json.add("keymap", HIDManagement::the().keymap_name()));
TRY(HIDManagement::the().keymap_data().with([&](auto const& keymap_data) {
return json.add("keymap", keymap_data.character_map_name->view());
}));
TRY(json.finish());
return {};
}