This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] NPTL pthread_mutex_cond_lock.c causes build break
- From: Steve Munroe <sjmunroe at us dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com, pawar at us dot ibm dot com
- Date: Wed, 24 Mar 2004 17:11:45 -0600
- Subject: [PATCH] NPTL pthread_mutex_cond_lock.c causes build break
- Organization: IBM LTC
- Reply-to: sjmunroe at vnet dot ibm dot com
The new pthread_mutex_cond_lock.c implementation uses
lll_mutex_cond_trylock(mutex) in its implementation but
lll_mutex_cond_trylock requires the address of the mutex lock work to
compile correctly. Otherwise we see the following build break:
In file included from
../nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c:8:
../nptl/pthread_mutex_lock.c: In function `__pthread_mutex_cond_lock':
../nptl/pthread_mutex_lock.c:83: error: invalid type argument of `unary *'
../nptl/pthread_mutex_lock.c:83: error: invalid type argument of `unary *'
../nptl/pthread_mutex_lock.c:100: error: invalid type argument of `unary *'
../nptl/pthread_mutex_lock.c:100: error: invalid type argument of `unary *'
The following patch fixes this by defining LLL_MUTEX_TRYLOCK(mutex) as
lll_mutex_cond_trylock(&mutex).
2004-03-11 Steven Munroe <sjmunroe@us.ibm.com>
* sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c[LLL_MUTEX_TRYLOCK]:
The lll_mutex_cond_trylock macro requires the mutex address.
diff -urN libc23-cvstip-20040324/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c libc23/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c
--- libc23-cvstip-20040324/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c 2004-03-24 00:28:07.000000000 -0600
+++ libc23/nptl/sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c 2004-03-24 14:51:42.000000000 -0600
@@ -1,7 +1,7 @@
#include <pthreadP.h>
#define LLL_MUTEX_LOCK(mutex) lll_mutex_cond_lock(mutex)
-#define LLL_MUTEX_TRYLOCK(mutex) lll_mutex_cond_trylock(mutex)
+#define LLL_MUTEX_TRYLOCK(mutex) lll_mutex_cond_trylock(&mutex)
#define __pthread_mutex_lock __pthread_mutex_cond_lock
#define NO_INCR