This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Remove __PTHREAD_MUTEX_HAVE_ELISION undefined warning
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>
- Date: Wed, 26 Mar 2014 09:36:47 -0700 (PDT)
- Subject: Re: [PATCH] Remove __PTHREAD_MUTEX_HAVE_ELISION undefined warning
- Authentication-results: sourceware.org; auth=none
- References: <5332D913 dot 5050903 at linux dot vnet dot ibm dot com>
> +#if !defined _PTHREAD_H
This is OK but there is no reason not to use #ifndef.
> +# error "Never include this file directly. Use <pthread.h> instead"
Two spaces between the sentences, and a period at the end of each.
(Those two also apply to the sysdeps variant files you're adding, of course.)
> +#define __PTHREAD_MUTEX_HAVE_ELISION 0
As Joseph also requested, add an explanatory comment describing the
protocol for this macro and how other sysdeps variant files might define
it.
> +#endif
> diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
> index 1e0c5dc..39d6b91 100644
> --- a/nptl/sysdeps/pthread/pthread.h
> +++ b/nptl/sysdeps/pthread/pthread.h
> @@ -26,6 +26,7 @@
> #include <bits/pthreadtypes.h>
> #include <bits/setjmp.h>
> #include <bits/wordsize.h>
> +#include <bits/pthread-elision.h>
I'd put it right after bits/pthreadtypes.h.
> --- a/posix/Makefile
> +++ b/posix/Makefile
> @@ -29,7 +29,7 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \
> bits/local_lim.h tar.h bits/utsname.h bits/confname.h \
> bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \
> bits/sched.h re_comp.h wait.h bits/environments.h cpio.h \
> - sys/sysmacros.h spawn.h bits/unistd.h
> + sys/sysmacros.h spawn.h bits/unistd.h bits/pthread-elision.h
That belongs in nptl/Makefile.
Thanks,
Roland