• spiiroin's avatar
    [usb-moded] Move synchronous mode switch to worker thread. Fixes JB#42757 · 57d404a3
    spiiroin authored
    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: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    57d404a3
Name
Last commit
Last update
config Loading commit data...
debian Loading commit data...
docs Loading commit data...
openembedded Loading commit data...
rpm Loading commit data...
scripts Loading commit data...
src Loading commit data...
systemd Loading commit data...
utils Loading commit data...
.depend Loading commit data...
Copyright Loading commit data...
LICENSE Loading commit data...
Makefile.am Loading commit data...
Makefile.custom Loading commit data...
README.md Loading commit data...
TODO Loading commit data...
autogen.sh Loading commit data...
config-static.h Loading commit data...
configure.ac Loading commit data...
depend_filter.py Loading commit data...
usb-moded.ini Loading commit data...
usb_moded.pc.in Loading commit data...