[PATCH RFC xserver] os: Add a mutex to protect io buffers

Adam Jackson ajax at nwnk.net
Thu Feb 23 16:55:28 UTC 2017


On Wed, 2017-02-22 at 15:20 -0800, Keith Packard wrote:
> > Adam Jackson <ajax at nwnk.net> writes:
> 
> > On Wed, 2017-02-22 at 16:50 +0100, Olivier Fourdan wrote:
> > > WriteToClient() can be called from XIChangeDeviceProperty() so from the
> > > InputThread which is a problem as it allocates and free the input and
> > > output buffers.
> 
> That seems like a bug to me; the input thread isn't supposed to be
> directly interacting with clients. Instead, it should queue a suitable
> work proc and have the events delivered from there. This will ensure
> proper serialization with request processing so that the right serial
> numbers and other data are inserted.

Sure. Though note the work queue API isn't thread-safe either at the
moment, neither when enqueueing new work nor walking the queue.

- ajax


More information about the xorg-devel mailing list