On Sat, Sep 10, 2016 at 09:14:19PM -0700, Alan Coopersmith wrote: > Autoconf logic borrowed from glib > > Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> > --- > configure.ac | 20 ++++++++++++++++++++ > include/dix-config.h.in | 6 ++++++ > os/inputthread.c | 12 ++++++++++++ > 3 files changed, 38 insertions(+) > > I have only tested this on Solaris, not MacOS or Linux, but since the > similar code in glib works on both, hope this will too. [...]
> diff --git a/os/inputthread.c b/os/inputthread.c > index 1cd1c2a..2ea39e7 100644 > --- a/os/inputthread.c > +++ b/os/inputthread.c > @@ -310,6 +310,12 @@ InputThreadDoWork(void *arg) > > inputThreadInfo->running = TRUE; > > +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) > + pthread_setname_np (pthread_self(), "InputThread"); > +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) > + pthread_setname_np ("InputThread"); > +#endif > + > ospoll_add(inputThreadInfo->fds, hotplugPipeRead, > ospoll_trigger_level, > InputThreadPipeNotify, > @@ -411,6 +417,12 @@ InputThreadPreInit(void) > fcntl(hotplugPipeRead, F_SETFL, O_NONBLOCK | O_CLOEXEC); > hotplugPipeWrite = hotplugPipe[1]; > > +#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID) > + pthread_setname_np (pthread_self(), "MainThread"); > +#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID) > + pthread_setname_np ("MainThread"); > +#endif > + this broke a few scripts here, e.g. ps -C Xorg won't work anymore because the program name is now MainThread. I understand why we'd want to label the input thread but do we get any benefit out of labelling the main thread? Cheers, Peter _______________________________________________ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel