This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
PATCH: Check __PTHREAD_MUTEX_HAVE_PREV for mutex initializers
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 11 May 2012 07:35:44 -0700
- Subject: PATCH: Check __PTHREAD_MUTEX_HAVE_PREV for mutex initializers
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch checks __PTHREAD_MUTEX_HAVE_PREV instead of __WORDSIZE
for mutex with prev. Tested on Linux/x86-64/x32/ia32. OK to install?
Thanks.
H.J.
* sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER): Check
__PTHREAD_MUTEX_HAVE_PREV instead of __WORDSIZE.
(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Likewise.
(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index bd97e85..8f10c87 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -83,7 +83,7 @@ enum
/* Mutex initializers. */
-#if __WORDSIZE == 64
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
# define PTHREAD_MUTEX_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, { 0, 0 } } }
# ifdef __USE_GNU