[RFC xserver] os: log a bug whenever WriteToClient is called from the input thread

Peter Hutterer peter.hutterer at who-t.net
Thu Feb 23 22:01:11 UTC 2017


On Thu, Feb 23, 2017 at 05:12:10PM +0100, walter harms wrote:
> 
> 
> Am 23.02.2017 01:22, schrieb Peter Hutterer:
> > The input thread should generate events, not send them. Make it easier to
> > find the instances where it's doing so.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  include/input.h  | 1 +
> >  os/inputthread.c | 7 +++++++
> >  os/io.c          | 6 ++++++
> >  3 files changed, 14 insertions(+)
> > 
> > diff --git a/include/input.h b/include/input.h
> > index bb58b22..6c9e45d 100644
> > --- a/include/input.h
> > +++ b/include/input.h
> > @@ -722,6 +722,7 @@ extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen
> >  extern _X_EXPORT void input_lock(void);
> >  extern _X_EXPORT void input_unlock(void);
> >  extern _X_EXPORT void input_force_unlock(void);
> > +extern _X_EXPORT int in_input_thread(void);
> >  
> >  extern void InputThreadPreInit(void);
> >  extern void InputThreadInit(void);
> > diff --git a/os/inputthread.c b/os/inputthread.c
> > index 4400fba..933bc1c 100644
> > --- a/os/inputthread.c
> > +++ b/os/inputthread.c
> > @@ -90,6 +90,12 @@ static pthread_mutex_t input_mutex;
> >  static Bool input_mutex_initialized;
> >  #endif
> >  
> > +int
> > +in_input_thread(void)
> > +{
> > +    return pthread_equal(pthread_self(), inputThreadInfo->thread);
> > +}
> > +
> >  void
> >  input_lock(void)
> >  {
> > @@ -531,6 +537,7 @@ void input_force_unlock(void) {}
> >  void InputThreadPreInit(void) {}
> >  void InputThreadInit(void) {}
> >  void InputThreadFini(void) {}
> > +int in_input_thread(void) { return 0; }
> >  
> >  int InputThreadRegisterDev(int fd,
> >                             NotifyFdProcPtr readInputProc,
> > diff --git a/os/io.c b/os/io.c
> > index be85226..5494b30 100644
> > --- a/os/io.c
> > +++ b/os/io.c
> > @@ -643,6 +643,9 @@ SetCriticalOutputPending(void)
> >   *    this routine as int.
> >   *****************/
> >  
> > +extern inline int
> > +in_input_thread(void);
> > +
> 
> maybe i am old fashion but this should be done with input.h, should it ?

it's a leftover from an earlier version, already removed in v2, thanks.

Cheers,
   Peter


More information about the xorg-devel mailing list