[PATCH xserver 4/8] Create a threaded mechanism for input [v3]

Mark Kettenis mark.kettenis at xs4all.nl
Wed Dec 9 23:53:22 PST 2015


> From: Keith Packard <keithp at keithp.com>
> Date: Wed, 09 Dec 2015 16:04:08 -0800
> 
> >> +extern _X_EXPORT pthread_mutex_t input_mutex;
> >> +extern _X_EXPORT __thread int input_mutex_count;
> >> +
> > Are these really meant to be exported - a wild guess will be that the
> > input drivers won't need access to these ?
> 
> Turns out they do - evdev needs to grab the input lock to handle button
> emulation via a timer.

Ugh.  Exporting global variables as part of the ABI is generally not
such a good idea.  Perhaps it is better to use functions to acquire
and release the input mutex instead?

Also, using TLS (i.e. __thread variables) isn't portable.  That
mechanism certainly isn't supported by all platforms supported by
Xorg.


More information about the xorg-devel mailing list