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

Olivier Fourdan ofourdan at redhat.com
Thu Feb 23 07:27:56 UTC 2017


Hi Alan,

> >>> 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.
> 
> Should WriteToClient() have something like
> 	assert(pthread_self() == mainThread)
> added to help catch things like that?

I very much like this idea, those bugs are a pain to trace...

Cheers,
Olivier


More information about the xorg-devel mailing list