mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
Kernel/HID: Take a spinlock when calling KeyboardClient::on_key_pressed
The KeyboardClient class member could be updated due to TTY switch, so we must ensure we always use a valid pointer.
This commit is contained in:
parent
b8493bf70f
commit
cd08c4a5aa
3 changed files with 14 additions and 3 deletions
|
@ -50,7 +50,7 @@ public:
|
|||
|
||||
u32 get_char_from_character_map(KeyEvent) const;
|
||||
|
||||
void set_client(KeyboardClient* client) { m_client = client; }
|
||||
void set_client(KeyboardClient* client);
|
||||
void set_maps(NonnullOwnPtr<KString> character_map_name, Keyboard::CharacterMapData const& character_map);
|
||||
|
||||
private:
|
||||
|
@ -63,6 +63,7 @@ private:
|
|||
KeyboardClient* m_client { nullptr };
|
||||
RefPtr<I8042Controller> m_i8042_controller;
|
||||
NonnullRefPtrVector<HIDDevice> m_hid_devices;
|
||||
Spinlock m_client_lock;
|
||||
};
|
||||
|
||||
class KeyboardClient {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue