From 4776fb251ce840be1099ffc481116d8a3ee8916a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 23 Aug 2009 19:38:06 +0200 Subject: Fix pthread_mutex_t static initializers Fix pthread_mutex_t static initializers by not leaving references to __pthread_recursive_mutexattr. * include/pthread/pthread.h.orig (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): New macro. * sysdeps/generic/pt-mutex-destroy.c (_pthread_mutex_destroy): Compare mutex->attr with __PTHREAD_ERRORCHECK_MUTEXATTR and __PTHREAD_RECURSIVE_MUTEXATTR instead of __pthread_recursive_mutexattr. * sysdeps/generic/pt-mutex-init.c (_pthread_mutex_init): Likewise. * sysdeps/generic/pt-mutex-timedlock.c (__pthread_mutex_timedlock_internal): Likewise. * sysdeps/generic/pt-mutex-transfer-np.c (__pthread_mutex_transfer_np): Likewise. * sysdeps/generic/pt-mutex-trylock.c (__pthread_mutex_trylock): Likewise. * sysdeps/generic/pt-mutex-unlock.c (__pthread_mutex_unlock): Likewise. * sysdeps/generic/pt-mutexattr.c (__pthread_errorcheck_mutexattr): New const. * sysdeps/generic/bits/mutex-attr.h (__pthread_errorcheck_mutexattr): Declare const. * sysdeps/generic/bits/mutex.h (__PTHREAD_ERRORCHECK_MUTEXATTR, __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER, __PTHREAD_RECURSIVE_MUTEXATTR): New macros. (__PTHREAD_RECURSIVE_MUTEX_INITIALIZER): Use __PTHREAD_RECURSIVE_MUTEXATTR macro instead of &__pthread_recursive_mutexattr. --- include/pthread/pthread.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/pthread/pthread.h') diff --git a/include/pthread/pthread.h b/include/pthread/pthread.h index dedb09d..fbe3294 100644 --- a/include/pthread/pthread.h +++ b/include/pthread/pthread.h @@ -313,6 +313,8 @@ extern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, /* Static initializer for recursive mutexes. */ #ifdef __USE_GNU +# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \ + __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ __PTHREAD_RECURSIVE_MUTEX_INITIALIZER #endif -- cgit v1.2.3