Skip to content
  • Keith Packard's avatar
    Create a threaded mechanism for input [v7] · 30ac7567
    Keith Packard authored
    
    
    The current SIGIO signal handler method, used at generation of input events,
    has a bunch of oddities. This patch introduces an alternative way using a
    thread, which is used to select() all input device file descriptors.
    
    A mutex was used to control the access to input structures by the main and input
    threads. Two pipes to emit alert events (such hotplug ones) and guarantee the
    proper communication between them was also used.
    
    Co-authored-by: default avatarFernando Carrijo <fcarrijo@freedesktop.org>
    Signed-off-by: default avatarTiago Vignatti <tiago.vignatti@nokia.com>
    
    v2: Fix non-Xorg link. Enable where supported by default.
    
        This also splits out the actual enabling of input threads to
        DDX-specific patches which follow
    
    v3: Make the input lock recursive
    
    v4: Use regular RECURSIVE_MUTEXes instead of rolling our own
        Respect the --disable-input-thread configuration option by
        providing stubs that expose the same API/ABI.
    
        Respond to style comments from Peter Hutterer.
    
    v5: use __func__ in inputthread debug and error mesages.
    
        Respond to style comments from Peter Hutterer.
    
    v6: use AX_PTHREAD instead of inlining pthread tests.
    
        Suggested by Emil Velikov <emil.l.velikov@gmail.com>
    
    v7: Use pthread_sigmask instead of sigprocmask when using threads
    
        Suggested by Adam Jackson <ajax@redhat.com>
    
    Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
    Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
    30ac7567