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 prev
- 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:27:04 -0700
- Subject: PATCH: Check __PTHREAD_MUTEX_HAVE_PREV for mutex prev
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
Hi,
This patch adds x32 thread types support. Since x32 has the same thread
implementation as x86-64, checking __WORDSIZE for mutex prev support
isn't appropriate. We should check __PTHREAD_MUTEX_HAVE_PREV instead.
Tested on Linux/x32, Linux/ia32 and Linux/x86-64. OK to install?
Thanks.
H.J.
---
* pthread_create.c (start_thread): Check __PTHREAD_MUTEX_HAVE_PREV
instead of __WORDSIZE.
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 0914885..3c1e479 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -355,7 +355,7 @@ start_thread (void *arg)
#ifndef __ASSUME_SET_ROBUST_LIST
/* If this thread has any robust mutexes locked, handle them now. */
-# if __WORDSIZE == 64
+# ifdef __PTHREAD_MUTEX_HAVE_PREV
void *robust = pd->robust_head.list;
# else
__pthread_slist_t *robust = pd->robust_list.__next;