Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[usb-moded] Move synchronous mode switch to worker thread. Fixes JB#4…
…2757 Mode switching in usb-moded is done via synchronous ipc / otherwise blocking operations - which makes usb-moded mainloop unable to process for example udev events / dbus requests from clients during the swich and causes potentially stale events to be seen after the mode switch. Separate mode selection from mode activation so that the latter is executed from worker thread. Distribute existing code in manner that makes the selection vs activation, or mainloop / worker thread separation more apparent: - control.c: Mode selection logic - worker.c: Mode activation logic And move miscellaneous functions that have accumulated into the main usb-moded module to: - common.c: Generic helper functions - sigpipe.c: Asynchronous signal trapping Rename all moved functions so that they still have prefix indicating the containing module. Refuse synchronous sleeps in order to terminate ongoing mode switch if udev events / other inputs invalidate the target of transition. Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
- Loading branch information
Showing
23 changed files
with
2,448 additions
and
1,507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.