xserver-multidpi/os
Keith Packard 30ac756798 Create a threaded mechanism for input [v7]
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: Fernando Carrijo <fcarrijo@freedesktop.org>
Signed-off-by: Tiago 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: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-05-26 16:07:54 -07:00
..
.gitignore dix and os: gitignore dix.O and os.O 2011-09-23 17:14:47 -07:00
access.c os: Treat ssh as a non-local client (v4) 2016-03-28 12:41:53 -04:00
auth.c os: support new implicit local user access mode [CVE-2015-3164 2/3] 2015-05-26 11:22:21 -07:00
backtrace.c Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
busfault.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
client.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
connection.c os: unifdef STREAMSCONN 2016-02-08 21:49:56 -05:00
inputthread.c Create a threaded mechanism for input [v7] 2016-05-26 16:07:54 -07:00
io.c os: Implement support for NotifyFd X_NOTIFY_WRITE 2015-12-01 13:55:07 -05:00
log.c os: Failure to remove a non-existent log file is not an error 2016-01-06 12:23:31 -05:00
Makefile.am Create a threaded mechanism for input [v7] 2016-05-26 16:07:54 -07:00
mitauth.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
oscolor.c Drop trailing whitespaces 2014-11-12 10:25:00 +10:00
osdep.h Fix build on Cygwin by ensuring WIN32 check triggers only on MinGW 2016-02-22 14:26:38 -05:00
osinit.c os: Add NotifyFd interfaces 2015-12-01 13:55:03 -05:00
reallocarray.c Import reallocarray() from OpenBSD 2015-04-21 16:57:08 -07:00
rpcauth.c Replace 'sun' with '__sun' 2015-11-30 11:51:22 -05:00
strcasecmp.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strcasestr.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcat.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strlcpy.c Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
strndup.c os: Ensure <dix-config.h> is included in strndup.c 2013-02-14 09:20:46 -08:00
utils.c Create a threaded mechanism for input [v7] 2016-05-26 16:07:54 -07:00
WaitFor.c os: Use NotifyFd interface for listen descriptors 2015-12-01 13:56:15 -05:00
xdmauth.c os: unifdef STREAMSCONN 2016-02-08 21:49:56 -05:00
xdmcp.c os: unifdef STREAMSCONN 2016-02-08 21:49:56 -05:00
xprintf.c os/xprintf: add Xvscnprintf and Xscnprintf 2012-05-03 14:59:23 +10:00
xsha1.c os/xsha1.c: Add license and copyright attribution. 2015-01-02 13:39:52 -08:00
xstrans.c Clean up a couple of warnings in os/ 2013-10-31 16:58:12 -07:00