mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 07:01:30 +00:00
[client] evdev: split teardown into stop and free phases
evdev_stop was never called, and calling it revealed unsafe teardown: the device list was freed before the thread was joined, a zero epoll descriptor was mistaken for a valid one, and the device loops walked past the end of the array through a sentinel that does not exist. Join the thread in evdev_stop and defer the rest to the new evdev_free. The display server grab hooks route into evdev until its event thread is joined, so the device state must stay valid until the display server has been freed; evdev_free then restores the hooks and releases the state.
This commit is contained in:
committed by
Geoffrey McRae
parent
c66a974f1d
commit
75f7d614a7
@@ -31,10 +31,16 @@ void evdev_earlyInit(void);
|
||||
bool evdev_start(void);
|
||||
|
||||
/**
|
||||
* stop the evdev layer
|
||||
* join the evdev thread; device state stays valid for callbacks
|
||||
*/
|
||||
void evdev_stop(void);
|
||||
|
||||
/**
|
||||
* restore the display server hooks and free the device state; only
|
||||
* call once display server callbacks have stopped
|
||||
*/
|
||||
void evdev_free(void);
|
||||
|
||||
/**
|
||||
* grab the keyboard for exclusive access
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user