[PATCH] Remove __PTHREAD_MUTEX_HAVE_ELISION undefined warning
Roland McGrath
roland@hack.frob.com
Wed Mar 26 16:36:00 GMT 2014
> +#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
More information about the Libc-alpha
mailing list